Commit 8bfcbb66 by David Baumgold

Make notifyOnError handler try to parse response as JSON

parent 923bcc55
...@@ -19,7 +19,10 @@ $ -> ...@@ -19,7 +19,10 @@ $ ->
if ajaxSettings.notifyOnError is false if ajaxSettings.notifyOnError is false
return return
if jqXHR.responseText if jqXHR.responseText
message = _.str.truncate(jqXHR.responseText, 300) try
message = JSON.parse(jqXHR.responseText).error
catch
message = _.str.truncate(jqXHR.responseText, 300)
else else
message = gettext("This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.") message = gettext("This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.")
msg = new CMS.Views.Notification.Error( msg = new CMS.Views.Notification.Error(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment