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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -342,7 +342,7 @@ public class ContentParser{
init();
}
//add comments starting with ##, but ignore links
//add comments starting with //, but ignore links
json = json.replace("http://", "http:~~").replace("https://", "https:~~").replaceAll("//.*?\n","\n").replace("http:~~", "http://").replace("https:~~", "https://");
JsonValue value = parser.fromJson(null, json);

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){