diff --git a/app/src/main/java/io/xpipe/app/util/FileOpener.java b/app/src/main/java/io/xpipe/app/util/FileOpener.java index 9484a995..1a0f4c47 100644 --- a/app/src/main/java/io/xpipe/app/util/FileOpener.java +++ b/app/src/main/java/io/xpipe/app/util/FileOpener.java @@ -57,7 +57,10 @@ public class FileOpener { try { editor.launch(Path.of(file).toRealPath()); } catch (Exception e) { - ErrorEvent.fromThrowable(e).handle(); + ErrorEvent.fromThrowable(e) + .description("Unable to launch editor " + editor.toTranslatedString() + + ". Maybe try to use a different one in the settings.") + .handle(); } } @@ -71,11 +74,12 @@ public class FileOpener { pc.executeSimpleCommand("open \"" + file + "\""); } } catch (Exception e) { - ErrorEvent.fromThrowable(e).handle(); + ErrorEvent.fromThrowable(e) + .description("Unable to open file " + file).handle(); } } - public static void openString(String keyName,Object key, String input, Consumer output) { + public static void openString(String keyName, Object key, String input, Consumer output) { FileBridge.get().openString(keyName, key, input, output, file -> openInTextEditor(file)); } } diff --git a/app/src/main/java/io/xpipe/app/util/TerminalHelper.java b/app/src/main/java/io/xpipe/app/util/TerminalHelper.java index 53c971b3..426b159a 100644 --- a/app/src/main/java/io/xpipe/app/util/TerminalHelper.java +++ b/app/src/main/java/io/xpipe/app/util/TerminalHelper.java @@ -4,6 +4,8 @@ import io.xpipe.app.core.AppI18n; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.core.process.CommandControl; +import java.io.IOException; + public class TerminalHelper { public static void open(String title, CommandControl cc) throws Exception { @@ -21,6 +23,10 @@ public class TerminalHelper { throw new IllegalStateException(AppI18n.get("noTerminalSet")); } - type.launch(title, command, false); + try { + type.launch(title, command, false); + } catch (Exception ex) { + throw new IOException("Unable to launch terminal " + type.toTranslatedString() + ". Maybe try to use a different one in the settings."); + } } }