Skip to content

Commit

Permalink
fix(storage, ios): surface underlying reason for unknown errors if po…
Browse files Browse the repository at this point in the history
…ssible
  • Loading branch information
mikehardy committed Jun 19, 2022
1 parent 1deed21 commit 6cd53ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/storage/ios/RNFBStorage/RNFBStorageCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ + (NSArray *)getErrorCodeMessage:(NSError *)error {
code = @"invalid-device-file-path";
message = @"The specified device file path is invalid or is restricted.";
} else {
message = @"An unknown error has occurred.";
if (userInfo[@"ResponseBody"]) {
message = [NSString stringWithFormat:@"An unknown error has occurred. (underlying reason '%@')", userInfo[@"ResponseBody"]];
} else {
message = @"An unknown error has occurred.";
}
}
break;
case FIRStorageErrorCodeObjectNotFound:
Expand Down

0 comments on commit 6cd53ea

Please sign in to comment.