Skip to content

Take in Error object and automatically find message #29

Open

Description

@nodesocket

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));

Activity

  1. DonutEspresso commented on Apr 9, 2016

    @DonutEspresso
    Member

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

  2. added this to the 5.x milestone on Apr 9, 2016
  3. nodesocket commented on Apr 11, 2016

    @nodesocket
    Author

    Great, any idea when 5.x will land?

  4. DonutEspresso commented on Sep 1, 2016

    @DonutEspresso
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions