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

Take in Error object and automatically find message #29

Open
nodesocket opened this issue Mar 28, 2016 · 3 comments
Open

Take in Error object and automatically find message #29

nodesocket opened this issue Mar 28, 2016 · 3 comments

Comments

@nodesocket
Copy link

Should be able to just pass an Error object and automatically fetch the error message from the Error object.

For example:

return next(new errors.BadRequestError(error));

Instead of (currently):

return next(new errors.BadRequestError(error.message));
@DonutEspresso
Copy link
Member

Once 5.x lands this will become the default behavior, as all errors created by restify-errors inherit from VError.

@DonutEspresso DonutEspresso added this to the 5.x milestone Apr 9, 2016
@nodesocket
Copy link
Author

nodesocket commented Apr 11, 2016

Great, any idea when 5.x will land?

@DonutEspresso
Copy link
Member

Oops - really sorry for not following up on this thread. I may have been confused, and thought you were asking about restify 4.x.

Are you basically wanting to create a new error, re-using only the error message itself but without creating a cause chain?

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