AriaMinaei / pretty-error

See node.js errors with less clutter
MIT License
1.52k stars 48 forks source link

Feature request: Reverse stack trace / message location #46

Open aight8 opened 7 years ago

aight8 commented 7 years ago

Stack traces are in generall have a not-ideal representation for CLI. If the stack is longer the message and the first trace item is at the beginning of the stack output. It would be nice if there were an option to reverse the output.

item 3 item 2 item 1

Error: The error message


This is lot easier to read, try it out!

Also I show a code frame (using babel code frame) of the last trace item. The problem currently is that the code frame represents the first entry, and the first entry, which stands at the first position of the list.

So there should be 2 options:

AriaMinaei commented 7 years ago

Hi @aight8,

I quite like the ideas you proposed in this issue and others (#45, #44, #43, #42). Implementing them shouldn't be too complicated, so I'd be happy to help you if you wanted to do them yourself and submit PRs. You can get started by running the test suite in debug mode to see how the whole thing works from start to finish.