Show failure messages when launching external applications

This commit is contained in:
crschnick 2024-01-26 12:15:15 +00:00
parent 715d36336c
commit a11ad4d486
2 changed files with 1 additions and 8 deletions

View file

@ -62,8 +62,6 @@ public class FileOpener {
editor.launch(Path.of(file).toRealPath()); editor.launch(Path.of(file).toRealPath());
} catch (Exception e) { } catch (Exception e) {
ErrorEvent.fromThrowable(e) ErrorEvent.fromThrowable(e)
.description("Unable to launch editor " + editor.toTranslatedString()
+ ".\nMaybe try to use a different editor in the settings.")
.expected() .expected()
.handle(); .handle();
} }

View file

@ -9,8 +9,6 @@ import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.core.process.ProcessControl; import io.xpipe.core.process.ProcessControl;
import io.xpipe.core.process.TerminalInitScriptConfig; import io.xpipe.core.process.TerminalInitScriptConfig;
import java.io.IOException;
public class TerminalHelper { public class TerminalHelper {
public static void open(String title, ProcessControl cc) throws Exception { public static void open(String title, ProcessControl cc) throws Exception {
@ -34,10 +32,7 @@ public class TerminalHelper {
try { try {
type.launch(config); type.launch(config);
} catch (Exception ex) { } catch (Exception ex) {
throw ErrorEvent.unreportable(new IOException( throw ErrorEvent.unreportable(ex);
"Unable to launch terminal " + type.toTranslatedString() + ": " + ex.getMessage()
+ ".\nMaybe try to use a different terminal in the settings.",
ex));
} }
} }
} }