Skip to content

Commit

Permalink
objectionary#3140: Made BuildFailureException more convenient
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed May 13, 2024
1 parent d9513a5 commit dfcc27e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ public class BuildFailureException extends RuntimeException {

/**
* Ctor.
* @param message The detail message.
* @param cause Cause.
* @param args Args.
*/
public BuildFailureException(final String message) {
super(message);
public BuildFailureException(final String cause, final Object... args) {
super(String.format(cause, args));
}

/**
* Ctor.
* @param message The detail message.
* @param cause The detail message.
* @param root Root cause exception.
*/
public BuildFailureException(final String message, final Throwable root) {
super(message, root);
public BuildFailureException(final String cause, final Throwable root) {
super(cause, root);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,9 @@ private void buildChecked(final Path cache) throws IOException {
final VerboseProcess.Result result = proc.waitFor();
if (result.code() != 0) {
throw new BuildFailureException(
String.format(
"Failed to build cargo project with dest = %s: %s",
project,
result.stdout()
)
"Failed to build cargo project with dest = %s: %s",
project,
result.stdout()
);
}
} catch (final InterruptedException ex) {
Expand Down

0 comments on commit dfcc27e

Please sign in to comment.