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
In the following script the error occurs at line 5.
try {
/*
* Trigger an error
*/
o = (Number) Double.valueOf(1);
} catch (Exception ex) {
ex.printStackTrace();
}
However the traceback information indicates that the error is at line 1 (the start of the try block):
bsh.EvalError: Sourced file: testCast.bsh unknown error: class java.lang.Double cannot be cast to class bsh.Primitive (java.lang.Double is in module java.base of loader 'bootstrap'; bsh.Primitive is in unnamed module of loader ca.spatial.util._bF @7a9273a8) : at Line: 1 : in file: testCast.bsh : try {
Caused by: Sourced file: testCast.bsh unknown error: class java.lang.Double cannot be cast to class bsh.Primitive (java.lang.Double is in module java.base of loader 'bootstrap'; bsh.Primitive is in unnamed module of loader ca.spatial.util._bF @7a9273a8) : at Line: 1 : in file: testCast.bsh : try {
Caused by: class java.lang.Double cannot be cast to class bsh.Primitive (java.lang.Double is in module java.base of loader 'bootstrap'; bsh.Primitive is in unnamed module of loader ca.spatial.util._bF @7a9273a8)
This loss of traceback information makes it difficult to locate the source of problems. It would be better if the full traceback of all previous chained exceptions was also displayed.
The text was updated successfully, but these errors were encountered:
I am confused though, this doesn't look like the output of the printStackTrace.
We have the correct error:
Caused by: class java.lang.Double cannot be cast to class bsh.Primitive (java.lang.Double is in module java.base of loader 'bootstrap'; bsh.Primitive is in unnamed module of loader ca.spatial.util._bF @7a9273a8)
And I am willing to bet it has the correct context too, somewhere we need to unwrap to get to this error. Hence my confusion whether this comes from Exception ex or not. We need to identify where the output comes from first.
In the following script the error occurs at line 5.
However the traceback information indicates that the error is at line 1 (the start of the try block):
This loss of traceback information makes it difficult to locate the source of problems. It would be better if the full traceback of all previous chained exceptions was also displayed.
The text was updated successfully, but these errors were encountered: