You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When printing out a stack trace, in the event a Rascal program terminates with an exception being thrown, the stacktrace of Rascal Shell (executed directly from the command line) differs from the stacktrace of the console/repl.
Executing it from the repl, gives this stac trace:
PS C:\Users\Tillaert\projects\test\src> java -jar C:\Users\Tillaert\Downloads\rascal-0.18.2.jar
Version: 0.18.2
INFO: detected |lib://rascal| at |jar+file:///C:/Users/Tillaert/Downloads/rascal-0.18.2.jar!/|
rascal>import TE;
Loading module |file:///C:/Users/Tillaert/projects/test/src/TE.rsc|
INFO: resolved |lib://rascal| at |jar+file:///C:/Users/Tillaert/Downloads/rascal-0.18.2.jar!/|
Loading module |lib://rascal/IO.rsc|
Loading module |lib://rascal/Exception.rsc|
ok
rascal>main();
|file:///C:/Users/Tillaert/projects/test/src/TE.rsc|(51,19,<6,7>,<6,26>): "Intentional Error"
at f2(|file:///C:/Users/Tillaert/projects/test/src/TE.rsc|(27,47,<5,0>,<7,1>))
at main(|file:///C:/Users/Tillaert/projects/test/src/TE.rsc|(111,18,<11,1>,<11,19>))
at $shell$(|prompt:///|(0,7,<1,0>,<1,7>)ok
rascal>
However, when executing the rascal code directly from the command line, the Rascal stacktrace is truncated (only showing the error) and a Java stack trace is shown instead:
PS C:\Users\Tillaert\projects\test\src> java -jar C:\Users\Tillaert\Downloads\rascal-0.18.2.jar TE.rsc
Version: 0.18.2
INFO: detected |lib://rascal| at |jar+file:///C:/Users/Tillaert/Downloads/rascal-0.18.2.jar!/|
INFO: resolved |lib://rascal| at |jar+file:///C:/Users/Tillaert/Downloads/rascal-0.18.2.jar!/|
unexpected error: /C:/Users/Tillaert/projects/test/src/TE.rsc:6,7: "Intentional Error"
org.rascalmpl.interpreter.control_exceptions.Throw: /C:/Users/Tillaert/projects/test/src/TE.rsc:6,7: "Intentional Error"
at org.rascalmpl.interpreter.control_exceptions.ControlException.reallyFillInStackTrace(ControlException.java:42)
at org.rascalmpl.interpreter.control_exceptions.Throw.fillInStackTrace(Throw.java:138)
at java.lang.Throwable.<init>(Throwable.java:265)
at java.lang.Exception.<init>(Exception.java:66)
at java.lang.RuntimeException.<init>(RuntimeException.java:62)
at org.rascalmpl.interpreter.control_exceptions.ControlException.<init>(ControlException.java:25)
at org.rascalmpl.interpreter.control_exceptions.Throw.<init>(Throw.java:73)
at org.rascalmpl.interpreter.control_exceptions.Throw.<init>(Throw.java:93)
at org.rascalmpl.semantics.dynamic.Statement$Throw.interpret(Statement.java:920)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:333)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:533)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:495)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:400)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:297)
at org.rascalmpl.interpreter.result.AbstractFunction.call(AbstractFunction.java:207)
at org.rascalmpl.interpreter.Evaluator.main(Evaluator.java:592)
at org.rascalmpl.shell.ModuleRunner.run(ModuleRunner.java:33)
at org.rascalmpl.shell.RascalShell.main(RascalShell.java:93)
Expected behavior
I would expect that, at least the complete rascal stack trace would be displayed. It would be nice, when no error occurs in the Java code itself, no Java stack trace is displayed (this adds noise to the output). The rascal runtime should still exit with a non-zero exit code.
The text was updated successfully, but these errors were encountered:
Describe the bug
When printing out a stack trace, in the event a Rascal program terminates with an exception being thrown, the stacktrace of Rascal Shell (executed directly from the command line) differs from the stacktrace of the console/repl.
To Reproduce
Steps to reproduce the behavior:
Given a small test program:
Executing it from the repl, gives this stac trace:
However, when executing the rascal code directly from the command line, the Rascal stacktrace is truncated (only showing the error) and a Java stack trace is shown instead:
Expected behavior
I would expect that, at least the complete rascal stack trace would be displayed. It would be nice, when no error occurs in the Java code itself, no Java stack trace is displayed (this adds noise to the output). The rascal runtime should still exit with a non-zero exit code.
The text was updated successfully, but these errors were encountered: