From 90db8536e2a5e3bc6ae9170b36da09677cee13cc Mon Sep 17 00:00:00 2001 From: olena ivashyna Date: Sun, 31 May 2015 13:27:51 -0700 Subject: [PATCH] Error callback for UserModal.save() --- _posts/2011-01-29-what-is-a-model.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_posts/2011-01-29-what-is-a-model.md b/_posts/2011-01-29-what-is-a-model.md index e967b500..0054111f 100644 --- a/_posts/2011-01-29-what-is-a-model.md +++ b/_posts/2011-01-29-what-is-a-model.md @@ -237,6 +237,9 @@ We will use the `save` api call which is intelligent and will send a PUT request user.save({name: 'Davis'}, { success: function (model) { alert(user.toJSON()); + }, + error: function () { + alert('Oops, could not save the user ' + user.toJSON()); } });