mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 01:16:30 +00:00
Pass error data to SaveErrorHandler on error
Change-Id: I9d7efbecfd954acff86f279f75aa80a9fcc10c89
This commit is contained in:
parent
1740eed0cf
commit
be548979fe
|
@ -744,8 +744,6 @@ ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, wasRetry
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
editApi = ve.getProp( data, 'visualeditoredit', 'edit' ) || {};
|
|
||||||
|
|
||||||
// Handle token errors
|
// Handle token errors
|
||||||
if ( data.error && data.error.code === 'badtoken' ) {
|
if ( data.error && data.error.code === 'badtoken' ) {
|
||||||
if ( wasRetry ) {
|
if ( wasRetry ) {
|
||||||
|
@ -782,6 +780,8 @@ ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, wasRetry
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
editApi = ve.getProp( data, 'visualeditoredit', 'edit' ) || data.error || {};
|
||||||
|
|
||||||
for ( name in saveErrorHandlerFactory.registry ) {
|
for ( name in saveErrorHandlerFactory.registry ) {
|
||||||
handler = saveErrorHandlerFactory.lookup( name );
|
handler = saveErrorHandlerFactory.lookup( name );
|
||||||
if ( handler.static.matchFunction( editApi ) ) {
|
if ( handler.static.matchFunction( editApi ) ) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ OO.initClass( ve.init.mw.SaveErrorHandler );
|
||||||
* @static
|
* @static
|
||||||
* @inheritable
|
* @inheritable
|
||||||
* @method
|
* @method
|
||||||
* @param {Object} editApi Edit API response
|
* @param {Object} editApi Edit API response, or error data
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
ve.init.mw.SaveErrorHandler.static.matchFunction = null;
|
ve.init.mw.SaveErrorHandler.static.matchFunction = null;
|
||||||
|
@ -37,7 +37,7 @@ ve.init.mw.SaveErrorHandler.static.matchFunction = null;
|
||||||
* @static
|
* @static
|
||||||
* @inheritable
|
* @inheritable
|
||||||
* @method
|
* @method
|
||||||
* @param {Object} editApi Edit API response
|
* @param {Object} editApi Edit API response, or error data
|
||||||
* @param {ve.init.mw.ArticleTarget} target Target
|
* @param {ve.init.mw.ArticleTarget} target Target
|
||||||
*/
|
*/
|
||||||
ve.init.mw.SaveErrorHandler.static.process = null;
|
ve.init.mw.SaveErrorHandler.static.process = null;
|
||||||
|
|
Loading…
Reference in a new issue