Quellcode durchsuchen

[RemoteConfig] Expose NSUnderlyingError to client (#11102)

Guglielmo Faglioni vor 3 Jahren
Ursprung
Commit
2c58866979
1 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen
  1. 7 6
      FirebaseRemoteConfig/Sources/RCNConfigFetch.m

+ 7 - 6
FirebaseRemoteConfig/Sources/RCNConfigFetch.m

@@ -515,12 +515,13 @@ static NSInteger const kRCNFetchResponseHTTPStatusCodeGatewayTimeout = 504;
         // Must set lastFetchStatus before setting Fetch Error.
         strongSelf->_settings.lastFetchStatus = FIRRemoteConfigFetchStatusFailure;
         strongSelf->_settings.lastFetchError = FIRRemoteConfigErrorInternalError;
-        NSDictionary<NSErrorUserInfoKey, id> *userInfo = @{
-          NSLocalizedDescriptionKey :
-              ([error localizedDescription]
-                   ?: [NSString
-                          stringWithFormat:@"Internal Error. Status code: %ld", (long)statusCode])
-        };
+        NSMutableDictionary<NSErrorUserInfoKey, id> *userInfo = [NSMutableDictionary dictionary];
+        userInfo[NSUnderlyingErrorKey] = error;
+        userInfo[NSLocalizedDescriptionKey] =
+            error.localizedDescription
+                ?: [NSString
+                       stringWithFormat:@"Internal Error. Status code: %ld", (long)statusCode];
+
         return [strongSelf
             reportCompletionWithStatus:FIRRemoteConfigFetchStatusFailure
                             withUpdate:nil