forked from EVOgeek/Vmeda.Online
		
	MOBILE-4341 core: Ignore native error codes in web
This commit is contained in:
		
							parent
							
								
									8e413bad8e
								
							
						
					
					
						commit
						844d03924f
					
				| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user