Display document import errors on iOS

This commit is contained in:
Anuken
2019-11-09 15:30:02 -05:00
parent fb15c44383
commit c70fb5940f
5 changed files with 9 additions and 5 deletions

View File

@@ -61,10 +61,14 @@ public class IOSLauncher extends IOSApplication.Delegate{
try{
controller.importDocument(documentURLs.get(0), new NSURL(getDocumentsDirectory() + "/document"), UIDocumentBrowserImportMode.Copy, (url, error) -> {
try{
cons.get(Core.files.absolute(url.getPath()));
}catch(Throwable t){
ui.showException(t);
if(error != null){
ui.showErrorMessage("Import error.\n" + error.getLocalizedFailureReason() + "\n" + error.getLocalizedDescription());
}else{
try{
cons.get(Core.files.absolute(url.getPath()));
}catch(Throwable t){
ui.showException(t);
}
}
});
}catch(Throwable t){