From d516f625c7395b510a496939ebd55c2d2b47f939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 14 Nov 2024 22:29:27 +0100 Subject: [PATCH] Fix forwarding promise rejection arguments Follow-up to arrow functions refactoring (a74c00ba8c256c3aa2f416f189c4256a59e37a0b). 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 --- modules/controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/controller.js b/modules/controller.js index 90dc35695..8479fe507 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -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 ) ) {