diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 56bb8ed..3f957b3 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -166,13 +166,14 @@ // 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])) { - + } 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])) { + MVMCoreLog(@"handling no page Error gracefully1"); + // handle gracefully even if no pageType/page in response, but success response info provided // 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. + MVMCoreLog(@"no page Error: "); + // Error, foreground request with no 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]; } @@ -499,6 +500,7 @@ // If the server told us there is an error screen but did not provide the page, show a critical error and log so we can have them fix it. if (error.errorScreenError && !error.nativeDrivenErrorScreen && loadObject.pageType.length == 0) { + MVMCoreLog(@"handling no page Error gracefully2"); // do not throw error if Page is not present in response [MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error]; } else { @@ -666,6 +668,7 @@ if (pageType) { [[MVMCoreCache sharedCache] addPageToCache:obj pageType:pageType queue:nil waitUntilFinished:YES completionBlock:NULL]; } else { + MVMCoreLog(@"Cache no page Error: "); errorObject = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeNoPageType domain:ErrorDomainNative location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]; } } else {