mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
Show server errors in the message edit form.
Refactor common code from compose into a util function. Trac #1455, #1448 (imported from commit 6fb691ac952b833655584b05f6caedaefe41c1a0)
This commit is contained in:
@@ -379,12 +379,7 @@ function send_message() {
|
||||
reload.initiate({immediate: true, send_after_reload: true});
|
||||
return;
|
||||
}
|
||||
var response = "Error sending message";
|
||||
if (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;
|
||||
}
|
||||
var response = util.xhr_error_message("Error sending message", xhr);
|
||||
compose_error(response, $('#new_message_content'));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user