PR Review comments fixed

This commit is contained in:
Danish Phiroz 2024-10-02 12:47:26 -04:00
parent 2b36711bca
commit a29fa60e5e

View File

@ -686,10 +686,10 @@
if (obj && [obj isKindOfClass:[NSDictionary class]]) { if (obj && [obj isKindOfClass:[NSDictionary class]]) {
NSDictionary *responseInfo = [obj dict:KeyResponseInfo]; NSDictionary *responseInfo = [obj dict:KeyResponseInfo];
//Response Info is missing but errorObject should be created with generic message + code + domain
if (responseInfo == nil) { if (responseInfo == nil) {
errorObject = [[MVMCoreLoadHandler sharedGlobal] errorForLoadObject:loadObject withTitle:nil message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeJSONNotDictionary domain:ErrorDomainSystem]; errorObject = [[MVMCoreLoadHandler sharedGlobal] errorForLoadObject:loadObject withTitle:nil message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] code:ErrorCodeJSONNotDictionary domain:ErrorDomainServer];
}else { }else if (![ValueTypeSuccess isEqualToString:[responseInfo string:KeyType]]) {
if (![ValueTypeSuccess isEqualToString:[responseInfo string:KeyType]]) {
errorObject = [[MVMCoreLoadHandler sharedGlobal] attachLoadInformation:loadObject toError: errorObject = [[MVMCoreLoadHandler sharedGlobal] attachLoadInformation:loadObject toError:
[[MVMCoreErrorObject alloc] [[MVMCoreErrorObject alloc]
initWithTitle:[responseInfo stringForKey:KeyErrorHeading] initWithTitle:[responseInfo stringForKey:KeyErrorHeading]
@ -699,7 +699,6 @@
domain:ErrorDomainServer domain:ErrorDomainServer
location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]]; location:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject]]];
} }
}
// Caches each dictionary from the array. // Caches each dictionary from the array.
[[MVMCoreCache sharedCache] addModuleToCache:obj module:key queue:nil waitUntilFinished:YES completionBlock:NULL]; [[MVMCoreCache sharedCache] addModuleToCache:obj module:key queue:nil waitUntilFinished:YES completionBlock:NULL];
} else { } else {