Skip to content

Commit

Permalink
Fix RecipeExceptionJS swallowing underlying errors
Browse files Browse the repository at this point in the history
MaxNeedsSnacks committed Jan 25, 2024
1 parent 118a57d commit df234fa
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -15,7 +15,19 @@ public RecipeExceptionJS(String m, Throwable cause) {

@Override
public String toString() {
return getLocalizedMessage();
var sb = new StringBuilder();
sb.append(getMessage());
if (error) {
sb.append(" [error]");
}

// append cause as well since RecipeExceptions can swallow underlying problems
if (getCause() != null) {
sb.append("\ncause: ");
sb.append(getCause());
}

return sb.toString();
}

public RecipeExceptionJS error() {

0 comments on commit df234fa

Please sign in to comment.