Skip to content

Commit

Permalink
Properly handle launcher errors
Browse files Browse the repository at this point in the history
  • Loading branch information
crschnick committed Jul 21, 2023
1 parent c2544d1 commit cc0763c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/src/main/java/io/xpipe/app/launcher/LauncherCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ public static void runLauncher(String[] args) {

var cmd = new CommandLine(new LauncherCommand());
cmd.setExecutionExceptionHandler((ex, commandLine, parseResult) -> {
new LogErrorHandler()
.handle(ErrorEvent.fromThrowable("Launcher command error occurred", ex)
.build());
OperationMode.halt(1);
var event = ErrorEvent.fromThrowable("Launcher command error occurred", ex).term().build();
// Print error in case we launched from the command-line
new LogErrorHandler().handle(event);
event.handle();
return 1;
});
cmd.setParameterExceptionHandler((ex, args1) -> {
new LogErrorHandler()
.handle(ErrorEvent.fromThrowable("Launcher parameter error occurred", ex)
.build());
OperationMode.halt(1);
var event = ErrorEvent.fromThrowable("Launcher parameter error occurred", ex).term().build();
// Print error in case we launched from the command-line
new LogErrorHandler().handle(event);
event.handle();
return 1;
});

Expand Down

0 comments on commit cc0763c

Please sign in to comment.