Commit 8bfcbb66 by David Baumgold

Make notifyOnError handler try to parse response as JSON

parent 923bcc55
...@@ -19,6 +19,9 @@ $ -> ...@@ -19,6 +19,9 @@ $ ->
if ajaxSettings.notifyOnError is false if ajaxSettings.notifyOnError is false
return return
if jqXHR.responseText if jqXHR.responseText
try
message = JSON.parse(jqXHR.responseText).error
catch
message = _.str.truncate(jqXHR.responseText, 300) 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.")
......
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