mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 09:43:30 +00:00
Fix forwarding promise rejection arguments
Follow-up to arrow functions refactoring
(a74c00ba8c
).
This caused API errors to be handled by showing an error box that
always used the message "Invalid response from server." (generated by
mw.Api#getErrorMessage) instead of the actual error message.
Change-Id: I1c347202f2c2d0a141ba09e6ad136f5d5dc2dc65
This commit is contained in:
parent
8821264a5e
commit
d516f625c7
|
@ -96,11 +96,11 @@ function getPageData( pageName, oldId, apiParams ) {
|
||||||
linterrors: linterrors,
|
linterrors: linterrors,
|
||||||
transcludedfrom: transcludedfrom,
|
transcludedfrom: transcludedfrom,
|
||||||
metadata: metadata
|
metadata: metadata
|
||||||
} ), () => {
|
} ), ( ...args ) => {
|
||||||
// Clear on failure
|
// Clear on failure
|
||||||
pageDataCache[ pageName ][ oldId ] = null;
|
pageDataCache[ pageName ][ oldId ] = null;
|
||||||
// Let caller handle the error
|
// Let caller handle the error
|
||||||
return $.Deferred().rejectWith( this, arguments );
|
return $.Deferred().reject( ...args );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
if ( $.isEmptyObject( apiParams ) ) {
|
if ( $.isEmptyObject( apiParams ) ) {
|
||||||
|
|
Loading…
Reference in a new issue