Removing unwanted testing logs code
This commit is contained in:
parent
2c9e394347
commit
7460f5b210
@ -167,13 +167,12 @@
|
|||||||
// Can continue loading with the page.
|
// Can continue loading with the page.
|
||||||
[MVMCoreLoadRequestOperation handleLoadObject:loadObject error:error];
|
[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])) {
|
} 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 no page error gracefully even if no pageType/page in response, but ResponseInfo has success
|
||||||
// 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.
|
// Something to show, or nothing was expected to show, can finish.
|
||||||
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
||||||
} else {
|
} else {
|
||||||
MVMCoreLog(@"no page Error: ");
|
|
||||||
// Error, foreground request with no alert, action, or anything else to show. Abort with error.
|
// 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]];
|
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];
|
[MVMCoreLoadRequestOperation loadAbortedWithError:error loadObject:loadObject];
|
||||||
}
|
}
|
||||||
@ -408,7 +407,6 @@
|
|||||||
|
|
||||||
// Handle any module caching error and continue load.
|
// Handle any module caching error and continue load.
|
||||||
if (moduleCachingError) {
|
if (moduleCachingError) {
|
||||||
MVMCoreLog(@"possible point 1 for no page error");
|
|
||||||
[MVMCoreLoadRequestOperation handleError:moduleCachingError loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
[MVMCoreLoadRequestOperation handleError:moduleCachingError loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,7 +422,6 @@
|
|||||||
|
|
||||||
// Handle any page caching error and continue load.
|
// Handle any page caching error and continue load.
|
||||||
if (pagesCachingError) {
|
if (pagesCachingError) {
|
||||||
MVMCoreLog(@"possible point 2 for no page error");
|
|
||||||
[MVMCoreLoadRequestOperation handleError:pagesCachingError loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
[MVMCoreLoadRequestOperation handleError:pagesCachingError loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,7 +433,6 @@
|
|||||||
[MVMCoreLoadRequestOperation notifyListenersOfNewResponse:pages modules:modules systemParameters:systemParameters loadObject:loadObject];
|
[MVMCoreLoadRequestOperation notifyListenersOfNewResponse:pages modules:modules systemParameters:systemParameters loadObject:loadObject];
|
||||||
} continueBlock:^{
|
} continueBlock:^{
|
||||||
if (error) {
|
if (error) {
|
||||||
MVMCoreLog(@"possible point 3 for no page error");
|
|
||||||
// Hold onto any error until we establish a delegate
|
// Hold onto any error until we establish a delegate
|
||||||
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:NO];
|
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:NO];
|
||||||
loadObject.operation.alertToShow = YES;
|
loadObject.operation.alertToShow = YES;
|
||||||
@ -503,8 +499,10 @@
|
|||||||
|
|
||||||
// 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 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) {
|
if (error.errorScreenError && !error.nativeDrivenErrorScreen && loadObject.pageType.length == 0) {
|
||||||
MVMCoreLog(@"handling no page Error gracefully2");
|
error.logError = YES;
|
||||||
// do not throw error if Page is not present in response
|
error.errorScreenError = NO;
|
||||||
|
error.location = [NSString stringWithFormat:@"%li-%@",(long)ErrorCodeNoErrorPageSent,error.location];
|
||||||
|
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
||||||
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
||||||
} else {
|
} else {
|
||||||
// No screen to load, finish the load.
|
// No screen to load, finish the load.
|
||||||
@ -671,7 +669,6 @@
|
|||||||
if (pageType) {
|
if (pageType) {
|
||||||
[[MVMCoreCache sharedCache] addPageToCache:obj pageType:pageType queue:nil waitUntilFinished:YES completionBlock:NULL];
|
[[MVMCoreCache sharedCache] addPageToCache:obj pageType:pageType queue:nil waitUntilFinished:YES completionBlock:NULL];
|
||||||
} else {
|
} 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]];
|
errorObject = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeNoPageType domain:ErrorDomainNative location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -756,7 +753,7 @@
|
|||||||
MVMCoreLog(@"Error: %@ %@ %@ %@ %@",[error stringErrorCode], error.domain, error.location,error.messageToDisplay, error.messageToLog);
|
MVMCoreLog(@"Error: %@ %@ %@ %@ %@",[error stringErrorCode], error.domain, error.location,error.messageToDisplay, error.messageToLog);
|
||||||
|
|
||||||
if (showAlertForErrorIfApplicable && (!loadObject.operation.backgroundLoad || loadObject.requestParameters.allowAlertsIfBackgroundRequest) && !loadObject.requestParameters.handleErrorsSilently && !error.silentError && !error.errorScreenError) {
|
if (showAlertForErrorIfApplicable && (!loadObject.operation.backgroundLoad || loadObject.requestParameters.allowAlertsIfBackgroundRequest) && !loadObject.requestParameters.handleErrorsSilently && !error.silentError && !error.errorScreenError) {
|
||||||
MVMCoreLog(@"last point for no page error");
|
|
||||||
// Show alert for error.
|
// Show alert for error.
|
||||||
[MVMCoreLoadRequestOperation createAndShowAlertForLoadObject:loadObject error:error delegateObject:loadObject.operation.delegateObject];
|
[MVMCoreLoadRequestOperation createAndShowAlertForLoadObject:loadObject error:error delegateObject:loadObject.operation.delegateObject];
|
||||||
}
|
}
|
||||||
@ -776,11 +773,9 @@
|
|||||||
|
|
||||||
// Native driven error screens still need to be loaded. (as long as the delegate desires)
|
// Native driven error screens still need to be loaded. (as long as the delegate desires)
|
||||||
if (!loadObject.requestParameters.handleErrorsSilently && !error.silentError && error.errorScreenError && (![loadObject.delegateObject.loadDelegate respondsToSelector:@selector(shouldContinueToErrorPage:error:)] || [loadObject.delegateObject.loadDelegate shouldContinueToErrorPage:loadObject error:error])) {
|
if (!loadObject.requestParameters.handleErrorsSilently && !error.silentError && error.errorScreenError && (![loadObject.delegateObject.loadDelegate respondsToSelector:@selector(shouldContinueToErrorPage:error:)] || [loadObject.delegateObject.loadDelegate shouldContinueToErrorPage:loadObject error:error])) {
|
||||||
MVMCoreLog(@"possible point 4 for no page error");
|
|
||||||
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
||||||
[MVMCoreLoadRequestOperation handleLoadObject:loadObject error:error];
|
[MVMCoreLoadRequestOperation handleLoadObject:loadObject error:error];
|
||||||
} else {
|
} else {
|
||||||
MVMCoreLog(@"possible point 5 for no page error");
|
|
||||||
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
||||||
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user