Merge pull request #3725 from NoelDeMartin/MOBILE-4341
MOBILE-4341 core: Ignore native error codes in webmain
commit
670bb10330
|
@ -512,6 +512,7 @@ export class CoreWSProvider {
|
|||
supportConfig: await CoreUserGuestSupportConfig.forSite(preSets.siteUrl),
|
||||
};
|
||||
|
||||
if (CorePlatform.isMobile()) {
|
||||
switch (data.status) {
|
||||
case NativeHttp.ErrorCode.SSL_EXCEPTION:
|
||||
options.errorcode = 'invalidcertificate';
|
||||
|
@ -544,9 +545,16 @@ export class CoreWSProvider {
|
|||
options.errorcode = 'requestprocessingfailed';
|
||||
options.errorDetails = CoreTextUtils.getErrorMessageFromError(data.error) ?? 'Request processing failed';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!options.errorcode) {
|
||||
switch (data.status) {
|
||||
case 404:
|
||||
options.errorcode = 'endpointnotfound';
|
||||
options.errorDetails = Translate.instant('core.ajaxendpointnotfound', { $a: CoreSite.MINIMUM_MOODLE_VERSION });
|
||||
options.errorDetails = Translate.instant('core.ajaxendpointnotfound', {
|
||||
$a: CoreSite.MINIMUM_MOODLE_VERSION,
|
||||
});
|
||||
break;
|
||||
default: {
|
||||
const details = CoreTextUtils.getErrorMessageFromError(data.error) ?? 'Unknown error';
|
||||
|
@ -558,6 +566,7 @@ export class CoreWSProvider {
|
|||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
throw new CoreAjaxError(options, 1, data.status);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue