Skip to content

Retain internal stack lines for errors, but color differently #2412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
szmarczak opened this issue Feb 24, 2020 · 5 comments
Closed

Retain internal stack lines for errors, but color differently #2412

szmarczak opened this issue Feb 24, 2020 · 5 comments

Comments

@szmarczak
Copy link

It would be quite useful because there's sometimes missing context.

@novemberborn
Copy link
Member

Could you provide more, uhm, context?

@szmarczak
Copy link
Author

szmarczak commented Feb 24, 2020

I see what you did here :P

Example:

  PromisableRequest._destroy (dist/source/core/index.js:935:21)
  PromisableRequest._beforeError (dist/source/core/index.js:855:14)
  dist/source/core/index.js:262:22

Full stack trace:

    at PromisableRequest._destroy (/home/szm/Desktop/got/dist/source/core/index.js:935:21)
    at PromisableRequest.destroy (internal/streams/destroy.js:55:8)
    at PromisableRequest._beforeError (/home/szm/Desktop/got/dist/source/core/index.js:855:14)
    at /home/szm/Desktop/got/dist/source/core/index.js:262:22
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

I think that at PromisableRequest.destroy (internal/streams/destroy.js:55:8) is quite important. Without this AVA implies that _beforeError called _destroy directly.

@novemberborn
Copy link
Member

Yea I don't really know why we even do this. If anything, we should use colors and separators to highlight the most useful lines, but not remove anything. Other than AVA-introduced lines.

IIRC this happens in https://github.com/avajs/ava/blob/master/lib/beautify-stack.js.

@novemberborn novemberborn changed the title Add an option to enable full stacktraces Don't remove so many internal lines from stack traces Mar 1, 2020
@novemberborn novemberborn changed the title Don't remove so many internal lines from stack traces Retain internal stack lines for errors, but color differently Mar 21, 2020
@novemberborn
Copy link
Member

@szmarczak so you filed #2110 last year, which is pretty similar 😉

There's a PR to fix that one (#2420) which is great. However I think we should still consider retaining the internal stack lines for all errors, whether or not they originated outside of user code, and use color to indicate their relevance.

So we'll keep this issue open.

@novemberborn
Copy link
Member

However I think we should still consider retaining the internal stack lines for all errors, whether or not they originated outside of user code, and use color to indicate their relevance.

I think this was addressed in #2420 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants