mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Prefer error *code* when logging unknown errors
See also I4a5bac24 Change-Id: I62fda9dadd24704f5930b30a2f8ad4d4a9e729cb
This commit is contained in:
parent
d1d4839f8f
commit
612e43dc08
|
@ -665,17 +665,14 @@ ve.init.mw.ArticleTarget.prototype.saveErrorBadToken = function ( username, erro
|
|||
* @fires saveErrorUnknown
|
||||
*/
|
||||
ve.init.mw.ArticleTarget.prototype.saveErrorUnknown = function ( editApi, data ) {
|
||||
var errorMsg = ( editApi && editApi.info ) ||
|
||||
( data && data.error && data.error.info ) ||
|
||||
( editApi && editApi.code ) ||
|
||||
( data && data.error && data.error.code ) ||
|
||||
'Unknown error';
|
||||
var errorMsg = ( editApi && editApi.info ) || ( data && data.error && data.error.info ),
|
||||
errorCode = ( editApi && editApi.code ) || ( data && data.error && data.error.code );
|
||||
|
||||
this.showSaveError(
|
||||
$( document.createTextNode( errorMsg ) ),
|
||||
$( document.createTextNode( errorMsg || errorCode || 'Unknown error' ) ),
|
||||
false // prevents reapply
|
||||
);
|
||||
this.emit( 'saveErrorUnknown', errorMsg );
|
||||
this.emit( 'saveErrorUnknown', errorCode || errorMsg || 'Unknown error' );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue