Skip to content

Reject with an error object #38

@jakecraige

Description

@jakecraige

I ran into a problem when using this with mocha. The problem is because when rejecting, this library returns a JS object instead of an Error object. I'd like to open up discussion for changing it to return an error object instead. The options can still be put on there for introspection purposes, but I think it makes more sense to reject with a true Error.

From what I can tell, this is where it happens: https://github.com/tyabonil/request-promise/blob/master/lib/rp.js#L48-L58 and you have tests ensuring this is the case here

Issue also reported to mocha: mochajs/mocha#1532

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions