-
Notifications
You must be signed in to change notification settings - Fork 44
Description
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?