Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature Request: cleaner stack traces #48
(Note: I have transpilation turned off. I know that feature would mess with this request significantly, and would require sourcemaps support to get right. So I'm only asking for the fix in non-transpiled mode at the moment.)
See this stack trace:
As you can see, most of that stack trace is entirely irrelevant to me, as it's stuff happening inside of RunJS (node, I guess?)... including the promise resolution, etc.
I know that the stack trace is not your doing, but it would be nice if you could edit its output to make it more friendly to read.
For example, this stack trace:
SyntaxError: Unexpected token : at <anonymous>:5:41 at <anonymous>:5:65 at resolve (/Applications/RunJS.app/Contents/Resources/electron.asar/renderer/web-frame-init.js:15:33) at new Promise (<anonymous>) at EventEmitter.ipcRenderer.on (/Applications/RunJS.app/Contents/Resources/electron.asar/renderer/web-frame-init.js:14:5) at EventEmitter.emit (events.js:182:13)
could maybe be truncated to just:
SyntaxError: Unexpected token : at <anonymous>:5:41 at <anonymous>:5:65
or even better, fixing the line/column numbers:
SyntaxError: Unexpected token : at <anonymous>:1:7
I know this is challenging to do, but it would be really nice to have at some point.
I just made sure I was on 1.2.4, and now I'm seeing something different, which is that if I have an error with only one line of code, no error shows...
...but if all I do is add an extra blank line to the program, now exceptions show up:
Also, not sure what the "unknown" part in those errors is supposed to indicate. The first snippet should say "ReferenceError" and the second one should say "SyntaxError".
The missing error for one line of code is a simple, dumb bug in my code. I will have a fix in my next release.
In my solution I will be dropping the "unknown: " part of the error and preserving the "SyntaxError: ".