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

make it easy to find causes of a particular kind #11

Closed
davepacheco opened this issue Mar 13, 2014 · 2 comments
Closed

make it easy to find causes of a particular kind #11

davepacheco opened this issue Mar 13, 2014 · 2 comments
Assignees

Comments

@davepacheco
Copy link
Contributor

It would be nice to have cause() take a "name" argument that walks the chain of causes until it finds one with the given name. That way you could do something like:

someHttpError.cause('SocketError')

Otherwise, people might end up depending on the exact cause chain (e.g., an HTTP error, then a socket error), which might break if a layer in between adds a useful intermediate message.

CC @jclulow @tjfontaine

@davepacheco
Copy link
Contributor Author

I've prototyped this in my branch for #10. See my comments there.

joyent-automation pushed a commit that referenced this issue Aug 11, 2016
#11 make it easy to find causes of a particular kind
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
@davepacheco
Copy link
Contributor Author

This has finally landed. I'll be publishing v1.7.0 with this change.

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

No branches or pull requests

1 participant