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
Print error stack when handed an error #46
Comments
That's not normally something you'd want to turn on and off? |
hmm -1 from me, I think errors should always be to stderr |
I'm inclined to say:
|
yeah in libs they should be emitted, but in your application etc you should delegate to something central for logging and output to stderr. Through the integration of whatever library into your application they should always reach there anyway so I dont think adding a bunch of if (err) debug(err) calls would help much |
Hmm, I totally agree with @ForbesLindesay's two points. It slipped my mind that I also think that there might be times when you want to print it under debug circumstances thought. I'm working on a small lib to easily build api servers and clients. On the server side you register all your functions which all can take a callback (which will be executed on the client). In the case of an error, you send it in as the first parameter of the callback. The error then gets serialized and sent over an socket to the client. When debugging this it's very nice to be able to log the In this case it would be really nice to have this feature. |
fair enough it'll be a tiny patch anyway |
Super, thanks! |
Feature request: When calling debug with an err as the first and only parameter, print a stack trace from it.
I would be happy to provide PR if you think this is a good idea.
The text was updated successfully, but these errors were encountered: