Skip to content

Commit 1c2964a

Browse files
Include failure reason in error from writeFile on iOS
1 parent 2e14e6b commit 1c2964a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ios/ReactNativeBlobUtilFS.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ + (void) writeFile:(NSString *)path
411411
[fileHandle closeFile];
412412
}
413413
else {
414-
if (![content writeToFile:path atomically:YES]) {
414+
if (![content writeToFile:path options:NSDataWritingAtomic error:&err]) {
415415
fm = nil;
416-
return reject(@"EUNSPECIFIED", [NSString stringWithFormat:@"File '%@' could not be written.", path], nil);
416+
return reject(@"EUNSPECIFIED", [NSString stringWithFormat:@"File '%@' could not be written; error: %@", path, [err description]], err);
417417
}
418418
}
419419
fm = nil;

0 commit comments

Comments
 (0)