2
0
Fork 0
mirror of https://github.com/ethauvin/rife2.git synced 2025-05-01 19:08:12 -07:00

Improved bld error reporting

This commit is contained in:
Geert Bevin 2023-03-27 20:43:48 -04:00
parent 81269fe52e
commit cf96234e81
2 changed files with 18 additions and 3 deletions

View file

@ -92,9 +92,24 @@ public class BuildExecutor {
exitStatus(1); exitStatus(1);
new HelpOperation(this, arguments()).executePrintOverviewHelp(); new HelpOperation(this, arguments()).executePrintOverviewHelp();
System.err.println(); System.err.println();
boolean first = true;
var e2 = e;
while (e2 != null) {
if (e2.getMessage() != null) {
if (!first) {
System.err.print("> ");
}
System.err.println(e2.getMessage());
first = false;
}
e2 = e2.getCause();
}
if (first) {
System.err.println(ExceptionUtils.getExceptionStackTrace(e)); System.err.println(ExceptionUtils.getExceptionStackTrace(e));
} }
} }
}
if (show_help) { if (show_help) {
help(); help();

View file

@ -18,12 +18,12 @@ public class UploadException extends RuntimeException {
private final String url_; private final String url_;
public UploadException(String url, int status) { public UploadException(String url, int status) {
super("An error occurred during while uploading to '" + url + "' : status code " + status); super("An error occurred while uploading to '" + url + "' : HTTP status code " + status);
url_ = url; url_ = url;
} }
public UploadException(String url, Throwable cause) { public UploadException(String url, Throwable cause) {
super("An error occurred during while uploading to '" + url + "'", cause); super("An error occurred while uploading to '" + url + "'", cause);
url_ = url; url_ = url;
} }