mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Log more precise error codes for timeout etc. (and HTTP statuses)
Inspired by the code in mw.Api#getErrorMessage handling these cases. Bug: T290514 Change-Id: I2eea17198dafaf9d3c4754cfb630de0ed7162daf
This commit is contained in:
parent
085ea2e8d1
commit
b52699ad35
|
@ -779,6 +779,13 @@ ReplyWidget.prototype.onReplyClick = function () {
|
|||
widget.errorMessage.$element.insertBefore( widget.replyBodyWidget.$element );
|
||||
}
|
||||
|
||||
// Log more precise error codes, mw.Api just gives us 'http' in all of these cases
|
||||
if ( data.textStatus === 'timeout' || data.textStatus === 'abort' || data.textStatus === 'parsererror' ) {
|
||||
code = data.textStatus;
|
||||
} else {
|
||||
code = 'http-' + ( ( data.xhr && data.xhr.status ) || 0 );
|
||||
}
|
||||
|
||||
logger( {
|
||||
action: 'saveFailure',
|
||||
message: code,
|
||||
|
|
Loading…
Reference in a new issue