Skip to content

Commit 6cd53ea

Browse files
committed
fix(storage, ios): surface underlying reason for unknown errors if possible
1 parent 1deed21 commit 6cd53ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/storage/ios/RNFBStorage/RNFBStorageCommon.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,11 @@ + (NSArray *)getErrorCodeMessage:(NSError *)error {
417417
code = @"invalid-device-file-path";
418418
message = @"The specified device file path is invalid or is restricted.";
419419
} else {
420-
message = @"An unknown error has occurred.";
420+
if (userInfo[@"ResponseBody"]) {
421+
message = [NSString stringWithFormat:@"An unknown error has occurred. (underlying reason '%@')", userInfo[@"ResponseBody"]];
422+
} else {
423+
message = @"An unknown error has occurred.";
424+
}
421425
}
422426
break;
423427
case FIRStorageErrorCodeObjectNotFound:

0 commit comments

Comments
 (0)