mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Merge "Prefer error *code* when logging unknown errors"
This commit is contained in:
commit
0cdf4393ed
|
@ -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