The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 52ddb56b authored by Chris Hallberg's avatar Chris Hallberg
Browse files

More robust Lightbox ajax error handling.

parent b44008a3
No related merge requests found
......@@ -81,8 +81,17 @@ var Lightbox = {
}
this.XHR = $.ajax(obj)
this.XHR.then().fail(function(response, textStatus) {
if (textStatus == "abort") { return; }
Lightbox.displayError(response.responseJSON.data);
if (textStatus == "abort") { return; }
if (response.responseJSON) {
Lightbox.displayError(response.responseJSON.data);
} else {
var json = JSON.parse(response.responseText);
if (json.data) {
Lightbox.displayError(json.data);
} else {
Lightbox.displayError(response.responseText);
}
}
});
return this.XHR;
},
......
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