Skip to content

Commit

Permalink
Show proper error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lqez committed Jan 4, 2019
1 parent 7b1fee7 commit d064a14
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@
})
.fail(function (jqXHR, textStatus, errorThrown) {
// if the error message from the server has any text in it, show it
var msg = jqXHR.responseText;
if (msg.length > 0) {
alert('Got an error uploading an image: ' + msg);
var msg = jqXHR.responseJSON;
if (msg && msg.message) {
alert(msg.message);
}
// otherwise, show something generic
else {
Expand Down

0 comments on commit d064a14

Please sign in to comment.