Skip to content
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

Remove 3rd party function calls from stack trace only when earlier than user code #1766

Closed
moll opened this issue Jun 27, 2015 · 4 comments · Fixed by gluckgames/pixi-packer#17

Comments

@moll
Copy link

moll commented Jun 27, 2015

Hey,

Shortening of stack traces is great, but it shouldn't suppress the exception's source from 3rd party (stuff in node_modules) function calls that come after user code. The ones leading up to user code are definitely useless (like two dozens of Mocha internal calls), but hiding the the path from user code to the possibly faulty library makes it a little difficult to discern the problem.

Case in point, I had a problem in a module:

      at normalizeValue (/Users/user/node_modules/whatwg-fetch/fetch.js:20:20)
      at Headers.append (/Users/user/node_modules/whatwg-fetch/fetch.js:45:13)
      at /Users/user/node_modules/whatwg-fetch/fetch.js:38:14
      at Array.forEach (native)
      at new Headers (/Users/user/node_modules/whatwg-fetch/fetch.js:37:43)
      at new Request (/Users/user/node_modules/whatwg-fetch/fetch.js:211:20)
      at self.fetch (/Users/user/node_modules/whatwg-fetch/fetch.js:276:17)
      at /Users/user/fetch.js:9:10
      ...

With short stack traces on, the only lines visible were:

      at Array.forEach (native)
      at /Users/user/fetch.js:9:10

Impossible to decipher. ;-)

@danielstjules
Copy link
Contributor

I think that's a good point! Easy fix is to drop

if (is.node && (isNodeModule(line) ||
from that bool exp

@jbnicolai
Copy link

I think I agree. @mochajs/mocha anyone else who has a strong oppinion on this?

@boneskull
Copy link
Member

👍

@dasilvacontin
Copy link
Contributor

👍 too.

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

Successfully merging a pull request may close this issue.

5 participants