Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing newline and handle syntaxes without documentation in Runtime Errors. #7383

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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-");
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/lang/english.lang
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ skript command:
log:
# runtime errors
runtime:
error: <light red>The script '<gray>%s<light red>' encountered an error while executing the '<gray>%s<light red>' %s<light red>:
error: <light red>The script '<gray>%s<light red>' encountered an error while executing the '<gray>%s<light red>' %s<light red>:\n
errors skipped: <gold>%d<light red> runtime error[s] were thrown but not printed in the last frame. From: <gray>%s
errors timed out: <gold>Line %d<light red> of script '<gray>%s<light red>' produced too many runtime errors (<gray>%d<light red> allowed per frame). No errors from this line will be printed for %d frames.
error notification: <light red>Script '<gray>%s<light red>' produced runtime errors. Please check console logs for details.
error notification plural: <light red>Script '<gray>%s<light red>' and %d others produced runtime errors. Please check console logs for details.

warning: <yellow>The script '<gray>%s<yellow>' encountered a warning while executing the '<gray>%s<yellow>' %s<yellow>:
warning: <yellow>The script '<gray>%s<yellow>' encountered a warning while executing the '<gray>%s<yellow>' %s<yellow>:\n
warnings skipped: <yellow>%d<yellow> runtime warning[s] were thrown but not printed in the last frame. From: <gray>%s
warnings timed out: <gold>Line %d<yellow> of script '<gray>%s<yellow>' produced too many runtime warnings (<gray>%d<yellow> allowed per frame). No warnings from this line will be printed for %d frames.
warning notification: <yellow>Script '<gray>%s<yellow>' produced runtime warnings. Please check console logs for details.
Expand Down
Loading