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

Stack trace not included in fs.copy error #58

Closed
bitmage opened this issue May 16, 2014 · 2 comments
Closed

Stack trace not included in fs.copy error #58

bitmage opened this issue May 16, 2014 · 2 comments

Comments

@bitmage
Copy link

bitmage commented May 16, 2014

To reproduce:

var fs = require('fs-extra');
fs.copy('/does/not/exist', '/something/else', function(err) {
    console.log('error:', err); // error is nested in array
    console.log('error stack:', err[0].stack); // message prints but no stack trace
});
  1. Why the array nesting? Is it necessary?
  2. Stack trace should be present. Mandatory for debugging.
@jprichardson
Copy link
Owner

Updated in 0.9.0. Fixed with [email protected]. i.e.:

err instanceof Error // => true
err.stack // is the source of an error

err.stack is the file/dir source of error. Not sure how a code trace would help.

@jgosmann
Copy link

For the record, I could have used a stack trace today in debugging an issue with Gatsby. The Gatsby CLI only prints the stack trace attached to the error (which is none in this case). I ended up hacking the Gatsby CLI to print a stack trace for the call site where the error is printed which led me back to the error callback. That ended up being sufficient in my case, but if I needed to know from where the fs.copy was called originally, I would have been out of luck.

Repository owner locked as off-topic and limited conversation to collaborators May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants