[go: nahoru, domu]

Skip to content

Commit

Permalink
[RemoteConfig] Expose NSUnderlyingError to client (firebase#11102)
Browse files Browse the repository at this point in the history
  • Loading branch information
guidev committed Apr 12, 2023
1 parent cce912f commit 2c58866
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions FirebaseRemoteConfig/Sources/RCNConfigFetch.m
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,13 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties
// 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
Expand Down

0 comments on commit 2c58866

Please sign in to comment.