From a74aa6ef2dd882b3b9b7f2a5daebc682e8bd8788 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Mon, 27 Feb 2023 14:17:01 -0500 Subject: [PATCH] Shift logging load errors until after background handling is resolved. --- .../LoadHandling/MVMCoreLoadRequestOperation.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 848d283..e48c6dc 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -439,6 +439,8 @@ NSString *messageStyle = [loadObject.responseInfoMap string:KeyMessageStyle]; if (messageStyle && (!loadObject.operation.backgroundLoad || loadObject.requestParameters.allowAlertsIfBackgroundRequest)) { loadObject.operation.alertToShow = YES; + } else { + error.silentError = YES; } } @@ -750,17 +752,19 @@ return; } - // Logs the error. - if (error.logError) { - [MVMCoreLoggingHandler addErrorToLog:error]; - } - 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) { // Show alert for error. [MVMCoreLoadRequestOperation createAndShowAlertForLoadObject:loadObject error:error delegateObject:loadObject.operation.delegateObject]; + } else { + error.silentError = YES; + } + + // Logs the error. + if (error.logError) { + [MVMCoreLoggingHandler addErrorToLog:error]; } }