diff --git a/common/src/main/java/dev/latvian/mods/kubejs/recipe/RecipeExceptionJS.java b/common/src/main/java/dev/latvian/mods/kubejs/recipe/RecipeExceptionJS.java index b5b5ad56f..aa09f9bf0 100644 --- a/common/src/main/java/dev/latvian/mods/kubejs/recipe/RecipeExceptionJS.java +++ b/common/src/main/java/dev/latvian/mods/kubejs/recipe/RecipeExceptionJS.java @@ -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() {