Clean up code duplication in settings.js error reporting.

We can save a bunch of code by using the handle ui.js error reporting
helpers.

(imported from commit 7e993cae6e314c84d4ba8eaefd2ff7711c4bc19d)
This commit is contained in:
David Roe
2015-08-20 16:23:53 -07:00
committed by Tim Abbott
parent 21ac93ae9c
commit 9590d988c5
2 changed files with 20 additions and 81 deletions

View File

@@ -133,7 +133,7 @@ exports.report_message = function (response, status_box, cls) {
};
exports.report_error = function (response, xhr, status_box) {
if (xhr.status.toString().charAt(0) === "4") {
if (xhr && xhr.status.toString().charAt(0) === "4") {
// Only display the error response for 4XX, where we've crafted
// a nice response.
response += ": " + $.parseJSON(xhr.responseText).msg;