Skip to content

Commit b1ee2a9

Browse files
authored
fix: improve error message (#921)
* fix: improve error message * Improve error message in funny-buses-invite Enhance the error message for better clarity.
1 parent 93692fd commit b1ee2a9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.changeset/funny-buses-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-native-documents/viewer": patch
3+
---
4+
5+
fix: improve error message

packages/document-viewer/ios/RNDocumentViewer.mm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ - (void)presentPreview:(NSString *)title
6969
resolve:(RCTPromiseResolveBlock)resolve
7070
reject:(RCTPromiseRejectBlock)reject {
7171
RNDPreviewItem *item = [[RNDPreviewItem alloc] initWithURL:restoredURL title:title];
72-
7372
dispatch_async(dispatch_get_main_queue(), ^{
7473
QLPreviewController *controller = [[RNDPreviewController alloc] initWithPreviewItem:item];
7574
controller.modalPresentationStyle = presentationStyle;
@@ -85,7 +84,7 @@ - (void)presentPreview:(NSString *)title
8584
}
8685
} else {
8786
[self.presentedUrl stopAccessingSecurityScopedResource];
88-
reject(RNDocViewerErrorUnableToOpenFileType, @"unsupported file", nil);
87+
reject(RNDocViewerErrorUnableToOpenFileType, @"QLPreviewController cannot preview this file. It may not be supported, or deleted.", nil);
8988
}
9089
});
9190
}

0 commit comments

Comments
 (0)