mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-25 08:17:11 -07:00
Interrupt execution when exception triggers during command execution.
Minor refactoring.
This commit is contained in:
parent
c912e4396e
commit
b9ac76b5b5
1 changed files with 53 additions and 49 deletions
|
@ -250,8 +250,20 @@ public class BuildExecutor {
|
|||
break;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
exitStatus(1);
|
||||
exitStatus(ExitStatusException.EXIT_FAILURE);
|
||||
outputCommandExecutionException(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (outputJson() && exitStatus_ == ExitStatusException.EXIT_SUCCESS) {
|
||||
System.out.println(json_template.getContent());
|
||||
}
|
||||
|
||||
return exitStatus_;
|
||||
}
|
||||
|
||||
private void outputCommandExecutionException(Throwable e) {
|
||||
if (outputJson()) {
|
||||
var t = TemplateFactory.JSON.get("bld.executor_error");
|
||||
if (showStacktrace) {
|
||||
|
@ -299,14 +311,6 @@ public class BuildExecutor {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (outputJson() && exitStatus_ == ExitStatusException.EXIT_SUCCESS) {
|
||||
System.out.println(json_template.getContent());
|
||||
}
|
||||
|
||||
return exitStatus_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the execution of the build. This method will call
|
||||
|
@ -554,7 +558,7 @@ public class BuildExecutor {
|
|||
System.err.println();
|
||||
System.err.println("ERROR: " + message);
|
||||
}
|
||||
exitStatus(1);
|
||||
exitStatus(ExitStatusException.EXIT_FAILURE);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue