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
As of today noder-js will catch and re-throw exceptions originating from loaded scripts. But when re-throwing in exception we are loosing the original stack trace which contains information paramount to the effective application debugging.
Consider this simple example:
which simply throws:
Uncaught TypeError: Cannot read property '+1:oid' of null
without giving me the line number / file name (at least in Chrome, it might be browser dependent). With a message as the only info it is really hard to debug effectively, especially bigger applications.
I'm painfully aware of the fact that exceptions / stack traces are in a lamentable state in JavaScript but IMO we need to improve the situation here as people might loose way to much time on debugging.
The text was updated successfully, but these errors were encountered:
I have tried to reproduce this issue with Chrome with this plunk (which uses hashspace and noder-js):
<script>varsomething=null;something[0]=10;// will throw an exception </script>
And I get the following error in the console, which contains the full expected stack:
Maybe you tested something a bit different?
Also, as you said, it seems to be browser-dependent: Firefox (with Firebug) only displays the last function call in the stack:
I am not sure if and how we can fix this. Of course, we have the stack property on the exception, but it is not as convenient as having the browser correctly displaying the stack (and being able to click on each item in the stack to view the source code).
For info, the stack property on Firefox looks like this:
"module.exports.$set@http://hashspace.ariatemplates.com/dist/0.0.5-SNAPSHOT/hashspace-noder.js:229:1
module.exports@http://hashspace.ariatemplates.com/dist/0.0.5-SNAPSHOT/hashspace-noder.js:315:13arguments[1].res@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js line 1313 > eval:14:1contextProto.moduleExecuteSync@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:1185:17contextProto.moduleRequire@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:1198:13bind$module/<@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:107:13arguments[1].res@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.jsline1313>eval:5:11contextProto.moduleExecuteSync@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:1185:17contextProto.moduleExecute/<@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:1226:17callback@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:162:37syncCall@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:67:17syncCalls@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:74:17asyncCall$module.nextTickCalls/<@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:97:25syncCall@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:67:17syncCalls@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:74:17syncTick@http://noder-js.ariatemplates.com/dist/v1.6.0/noder.dev.js:80:17
"
As of today noder-js will catch and re-throw exceptions originating from loaded scripts. But when re-throwing in exception we are loosing the original stack trace which contains information paramount to the effective application debugging.
Consider this simple example:
which simply throws:
without giving me the line number / file name (at least in Chrome, it might be browser dependent). With a message as the only info it is really hard to debug effectively, especially bigger applications.
While what I would expect is this:
I'm painfully aware of the fact that exceptions / stack traces are in a lamentable state in JavaScript but IMO we need to improve the situation here as people might loose way to much time on debugging.
The text was updated successfully, but these errors were encountered: