AriaMinaei / AriaMinaei/pretty-error

some stack miss when error is thrown in eval()

Open
#37 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
CoffeeScript
Stars
1.5k
Forks
51
PR merge metrics
No merged PRs in 30d

Description

example code:

```
var pe = new (require("pretty-error"));

try {
eval(`(function fn(){
throw new Error('some error');
})()`)
} catch(e) {
console.log(e.stack);
console.log(pe.render(e));
}
```

result:

```
Error: some error
at fn (eval at (S:\_TEST_\index.js:4:2), :2:9)
at eval (eval at (S:\_TEST_\index.js:4:2), :3:4)
at Object. (S:\_TEST_\index.js:4:2)
at Module._compile (module.js:570:32)

Error: some error
- index.js:4 Object.
S:/_TEST_/index.js:4:2

- module.js:570 Module._compile
module.js:570:32
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Begin with the supplied Node.js eval() example and compare the native e.stack frames with pe.render(e). Trace the stack-rendering entry point in the repository; done means the eval() frames are preserved and rendered rather than omitted, while the existing output remains formatted correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, node.js
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.