From 74e08ca87a1822fb0521771090227a218bb080ba Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Tue, 3 Aug 2021 19:38:32 +0530 Subject: [PATCH] Removing loadAborted to handle No Page errors gracefully. --- .../MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 8b85d04..de1488b 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -166,15 +166,9 @@ // Can continue loading with the page. [MVMCoreLoadRequestOperation handleLoadObject:loadObject error:error]; - } else if (loadObject.operation.backgroundLoad || loadObject.requestParameters.noViewControllerToLoad || ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(hasContentToShow:error:)] && [[MVMCoreObject sharedInstance].globalLoadDelegate hasContentToShow:loadObject error:error]) || (loadObject.pageType.length == 0 && [[loadObject.responseInfoMap stringForKey:KeyType] isEqualToString:ValueTypeSuccess])) { - // handle no page error gracefully even if no pageType/page in response, but ResponseInfo has success + } else { // Something to show, or nothing was expected to show, can finish. [MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error]; - } else { - - // Error, foreground request with no page, alert, action, or anything else to show. Abort with error. - MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeNoPageType domain:ErrorDomainNative location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]; - [MVMCoreLoadRequestOperation loadAbortedWithError:error loadObject:loadObject]; } }]; }];