diff --git a/src/main/java/org/skriptlang/skript/log/runtime/ErrorSource.java b/src/main/java/org/skriptlang/skript/log/runtime/ErrorSource.java index 10627724302..df3664303b7 100644 --- a/src/main/java/org/skriptlang/skript/log/runtime/ErrorSource.java +++ b/src/main/java/org/skriptlang/skript/log/runtime/ErrorSource.java @@ -32,7 +32,8 @@ public record ErrorSource( * @return A new error source. */ public static @NotNull ErrorSource fromNodeAndElement(@Nullable Node node, @NotNull SyntaxElement element) { - String elementName = element.getClass().getAnnotation(Name.class).value().trim().replaceAll("\n", ""); + Name annotation = element.getClass().getAnnotation(Name.class); + String elementName = annotation != null ? annotation.value().trim().replaceAll("\n", "") : element.getClass().getSimpleName(); if (node == null) { return new ErrorSource(element.getSyntaxTypeName(), elementName, 0, "-unknown-", "-unknown-"); } diff --git a/src/main/resources/lang/english.lang b/src/main/resources/lang/english.lang index c133efffdd5..9350961b1b4 100644 --- a/src/main/resources/lang/english.lang +++ b/src/main/resources/lang/english.lang @@ -133,13 +133,13 @@ skript command: log: # runtime errors runtime: - error: The script '%s' encountered an error while executing the '%s' %s: + error: The script '%s' encountered an error while executing the '%s' %s:\n errors skipped: %d runtime error[s] were thrown but not printed in the last frame. From: %s errors timed out: Line %d of script '%s' produced too many runtime errors (%d allowed per frame). No errors from this line will be printed for %d frames. error notification: Script '%s' produced runtime errors. Please check console logs for details. error notification plural: Script '%s' and %d others produced runtime errors. Please check console logs for details. - warning: The script '%s' encountered a warning while executing the '%s' %s: + warning: The script '%s' encountered a warning while executing the '%s' %s:\n warnings skipped: %d runtime warning[s] were thrown but not printed in the last frame. From: %s warnings timed out: Line %d of script '%s' produced too many runtime warnings (%d allowed per frame). No warnings from this line will be printed for %d frames. warning notification: Script '%s' produced runtime warnings. Please check console logs for details.