diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index bebb54d..64e5bce 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -686,19 +686,18 @@ if (obj && [obj isKindOfClass:[NSDictionary class]]) { NSDictionary *responseInfo = [obj dict:KeyResponseInfo]; + //Response Info is missing but errorObject should be created with generic message + code + domain if (responseInfo == nil) { - errorObject = [[MVMCoreLoadHandler sharedGlobal] errorForLoadObject:loadObject withTitle:nil message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeJSONNotDictionary domain:ErrorDomainSystem]; - }else { - if (![ValueTypeSuccess isEqualToString:[responseInfo string:KeyType]]) { - errorObject = [[MVMCoreLoadHandler sharedGlobal] attachLoadInformation:loadObject toError: - [[MVMCoreErrorObject alloc] - initWithTitle:[responseInfo stringForKey:KeyErrorHeading] - message:[responseInfo stringForKey:KeyUserMessage] - messageToLog:[responseInfo stringForKey:KeyMessage] - code:[[responseInfo string:KeyCode] integerValue] - domain:ErrorDomainServer - location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]]; - } + errorObject = [[MVMCoreLoadHandler sharedGlobal] errorForLoadObject:loadObject withTitle:nil message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeJSONNotDictionary domain:ErrorDomainServer]; + }else if (![ValueTypeSuccess isEqualToString:[responseInfo string:KeyType]]) { + errorObject = [[MVMCoreLoadHandler sharedGlobal] attachLoadInformation:loadObject toError: + [[MVMCoreErrorObject alloc] + initWithTitle:[responseInfo stringForKey:KeyErrorHeading] + message:[responseInfo stringForKey:KeyUserMessage] + messageToLog:[responseInfo stringForKey:KeyMessage] + code:[[responseInfo string:KeyCode] integerValue] + domain:ErrorDomainServer + location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]]; } // Caches each dictionary from the array. [[MVMCoreCache sharedCache] addModuleToCache:obj module:key queue:nil waitUntilFinished:YES completionBlock:NULL];