Better handle markdown io errors

This commit is contained in:
crschnick 2024-02-28 14:13:07 +00:00
parent f42434c60e
commit fb8e990083

View file

@ -7,6 +7,7 @@ import io.xpipe.app.fxcomps.CompStructure;
import io.xpipe.app.fxcomps.SimpleCompStructure;
import io.xpipe.app.fxcomps.util.PlatformThread;
import io.xpipe.app.fxcomps.util.SimpleChangeListener;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.util.Hyperlinks;
import io.xpipe.app.util.MarkdownHelper;
@ -66,7 +67,8 @@ public class MarkdownComp extends Comp<CompStructure<StackPane>> {
var contentUrl = file.toUri();
wv.getEngine().load(contentUrl.toString());
} catch (IOException e) {
throw new RuntimeException(e);
// Any possible IO errors can occur here
ErrorEvent.fromThrowable(e).expected().handle();
}
});