2
0
Fork 0
mirror of https://github.com/ethauvin/rife2.git synced 2025-04-30 10:38: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,7 +92,22 @@ public class BuildExecutor {
exitStatus(1);
new HelpOperation(this, arguments()).executePrintOverviewHelp();
System.err.println();
System.err.println(ExceptionUtils.getExceptionStackTrace(e));
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));
}
}
}

View file

@ -18,12 +18,12 @@ public class UploadException extends RuntimeException {
private final String url_;
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;
}
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;
}