AriaMinaei / AriaMinaei/pretty-error

Document .stop() / a way to obtain unmodified stack traces

Open
#53 1 comment 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
CoffeeScript
Stars
1.5k
Forks
51
PR merge metrics
No merged PRs in 30d

Description

I had an issue where I needed to obtain an un-modified stack trace for another package to parse information out of. In the end I solved it as:

```
pe.stop();
const stack = (new Error()).stack;
pe.start();
```

It took some digging and intuition to find .stop() so it would be helpful if this was mentioned in the readme.

The reason I didn't individually format errors instead of .start() is that I have many places where errors may be output, but only one where I need this raw trace.

**Question:** Is the original .stack stored anywhere? I think it would be great to be able to access it, as well as the ParsedError (to eliminate the need for other parsing packages since the message is parsed once here anyway)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the README and the documented .stop()/.start() API, then verify whether the package exposes an unmodified Error.stack or ParsedError. Done means the README explains the raw-stack workaround and the issue's API question is answered or documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, node.js
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.