From 4799c3fcbba9a79d1e468f7172fa6d0de651ab2e Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Mon, 13 Mar 2023 16:13:44 -0400 Subject: [PATCH] Add image loading failures to error log. --- MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m index c402552..4c121bf 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m @@ -592,6 +592,10 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt"; //system stores cache based datatask and check cache based on response, //need to manually store cache for response [sharedCache storeCachedResponse:cachedReponse forRequest:request]; + } else if (error) { + [MVMCoreLoggingHandler addErrorToLog:[MVMCoreErrorObject createErrorObjectForNSError:error location:@"MVMCoreCache->downloadImage"]]; + } else { + [MVMCoreLoggingHandler addErrorToLog:[[MVMCoreErrorObject alloc] initWithTitle:nil messageToLog:[NSString stringWithFormat:@"Failed to download image %@", request.URL.absoluteString] code:0 domain:ErrorDomainSystem location:@"MVMCoreCache->downloadImage"]]; } if (isGif) { [self checkImage:nil imageData:data fallbackImage:fallbackImageName completionHandler:completionHandler];