-
Notifications
You must be signed in to change notification settings - Fork 195
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
Js error message became [object Object] #434
Comments
Do you have some example code that you can share that triggers this? |
sorry for the late reply, we have the handlebars.js 3.x running, and it's just an error thrown in javascript like https://github.com/handlebars-lang/handlebars.js/blob/v3.0.8/lib/handlebars/runtime.js#L198, the message is lot in between |
Hey it seems that Handlebars JS has created their own custom exception which seems to be the problem. Here is a minimal example that outlines the problem
|
I've done some digging and this was introduced in this commit. We were using the "js.nashorn-compat" mode but when they became combined it broke our functionality. Here is the line in question before - after. (JSUserObject has since been renamed to JSOrdinary). Would it be possible to add an option to go back to the previous way of displaying errors? |
A simple workaround for this would be to set the constructor property on the prototype of the custom error: Alternatively, you could use just subclass Error, e.g. It would probably make sense to show the message also without the constructor property. We'll look into that. |
js script exception not being extracted properly after 19.x.x
we noticed that exceptions changes from having actual message (in this case we have some errors from handlebars.js), to having
[object Object]
when upgrading from 19.3.1 to 21.0.0, looking at https://github.com/oracle/graaljs/blob/master/graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/UserScriptException.java it seems likegetMessage
is changed between the versions...specifically https://github.com/oracle/graaljs/blob/master/graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/UserScriptException.java#L125 returns
null
, and that's fromcom.oracle.truffle.object.DynamicObjectLibraryImpl
thinks
DynamicObject<JSError>
has noconstructor
....The text was updated successfully, but these errors were encountered: