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:
Bartosz Dziewoński 2024-11-14 22:29:27 +01:00
parent 8821264a5e
commit d516f625c7

View file

@ -96,11 +96,11 @@ function getPageData( pageName, oldId, apiParams ) {
linterrors: linterrors,
transcludedfrom: transcludedfrom,
metadata: metadata
} ), () => {
} ), ( ...args ) => {
// Clear on failure
pageDataCache[ pageName ][ oldId ] = null;
// Let caller handle the error
return $.Deferred().rejectWith( this, arguments );
return $.Deferred().reject( ...args );
} );
if ( $.isEmptyObject( apiParams ) ) {