Skip to content

Missing time metrics on error #10

@woodenconsulting

Description

@woodenconsulting

Using request-promise and the time config <- (scroll down a bit), the various time metrics applied to the original request context are not accessible when an error is thrown. While they can be accessed when the promise resolves by using the resolveWithFullResponse, they are not accessible on error; a custom request error is created and thrown.

Using request directly, I can access the original context to pull this information when there is an error, see example. I don't see a way to do this with request-promise - it would seem that this information would need to be added to RequestError, StatusCodeError and TransformError respectively.

Is there something I missed that makes this information accessible on error and if not can we add those metrics to the existing errors if time is enabled?

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