Fix error handling in controller#getPageData

We were accidentally resolving the promise with `undefined`, rather
than rejecting it. This later caused "TypeError: Cannot read property
'linterrors' of undefined" in controller#checkCommentOnPage.

Bug: T260294
Change-Id: I29418988023d86140cfa110c0c348059b293a716
This commit is contained in:
Bartosz Dziewoński 2020-08-12 23:37:10 +02:00
parent b706eac8bc
commit 03539527b4

View file

@ -101,6 +101,8 @@ function getPageData( pageName, oldId ) {
}, function () { }, function () {
// Clear on failure // Clear on failure
pageDataCache[ pageName ][ oldId ] = null; pageDataCache[ pageName ][ oldId ] = null;
// Let caller handle the error
return $.Deferred().rejectWith( this, arguments );
} ); } );
return pageDataCache[ pageName ][ oldId ]; return pageDataCache[ pageName ][ oldId ];
} }