Skip to content

Commit

Permalink
make the err msg short
Browse files Browse the repository at this point in the history
  • Loading branch information
krasinski committed Sep 1, 2024
1 parent 9a8df8d commit 70ded53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public ValStr apply(Env env, Env.StackHelp stk, AstRoot[] asts) {
Method mainMethod = clazz.getDeclaredMethod("mainInternal", String[].class);
mainMethod.invoke(null, new Object[]{args});
} catch (Exception e) {
throw new RuntimeException(e);
RuntimeException exceptionWithShortStacktrace = new RuntimeException(e.getMessage());
exceptionWithShortStacktrace.setStackTrace(new StackTraceElement[]{e.getStackTrace()[0]});
throw exceptionWithShortStacktrace;
}
return new ValStr("OK");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void main(String[] args) throws IOException {
try {
mainInternal(args);
} catch (IllegalArgumentException e) {
System.err.println((e.getMessage());
System.err.println((e.getMessage()));
System.exit(1);
}
}
Expand Down

0 comments on commit 70ded53

Please sign in to comment.