Skip to content

Commit

Permalink
Merge pull request #220 from TheAlmightyBob/ReportWriteFileError
Browse files Browse the repository at this point in the history
Include failure reason in error from writeFile on iOS
  • Loading branch information
RonRadtke authored Feb 24, 2023
2 parents 08ccf28 + 1c2964a commit aaec2c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ios/ReactNativeBlobUtilFS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,9 @@ + (void) writeFile:(NSString *)path
[fileHandle closeFile];
}
else {
if (![content writeToFile:path atomically:YES]) {
if (![content writeToFile:path options:NSDataWritingAtomic error:&err]) {
fm = nil;
return reject(@"EUNSPECIFIED", [NSString stringWithFormat:@"File '%@' could not be written.", path], nil);
return reject(@"EUNSPECIFIED", [NSString stringWithFormat:@"File '%@' could not be written; error: %@", path, [err description]], err);
}
}
fm = nil;
Expand Down

0 comments on commit aaec2c7

Please sign in to comment.