mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user