[@types/request-promise-native] Update response in errors.

The response value on the errors is the modified Response instance not
the basic `http.IncomingMessage`. The `Response` interface in
`@types/request` is relatively new and this file was missed during the
update.
This commit is contained in:
Matt R. Wilson 2018-02-28 15:45:47 -07:00
parent 42676ad912
commit ab0791e8eb
No known key found for this signature in database
GPG Key ID: 4457EACA9CCA31C4

View File

@ -1,15 +1,14 @@
import rp = require('.');
import http = require('http');
export interface RequestError extends Error {
cause: any;
error: any;
options: rp.Options;
response: http.IncomingMessage;
response: rp.FullResponse;
}
export interface RequestErrorConstructor {
new(cause: any, options: rp.Options, response: http.IncomingMessage): RequestError;
(cause: any, options: rp.Options, response: http.IncomingMessage): RequestError;
new(cause: any, options: rp.Options, response: rp.FullResponse): RequestError;
(cause: any, options: rp.Options, response: rp.FullResponse): RequestError;
prototype: RequestError;
}
export const RequestError: RequestErrorConstructor;
@ -18,11 +17,11 @@ export interface StatusCodeError extends Error {
statusCode: number;
error: any;
options: rp.Options;
response: http.IncomingMessage;
response: rp.FullResponse;
}
export interface StatusCodeErrorConstructor extends Error {
new(statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError;
(statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError;
new(statusCode: number, body: any, options: rp.Options, response: rp.FullResponse): StatusCodeError;
(statusCode: number, body: any, options: rp.Options, response: rp.FullResponse): StatusCodeError;
prototype: StatusCodeError;
}
export const StatusCodeError: StatusCodeErrorConstructor;
@ -31,11 +30,11 @@ export interface TransformError extends Error {
cause: any;
error: any;
options: rp.Options;
response: http.IncomingMessage;
response: rp.FullResponse;
}
export interface TransformErrorConstructor extends Error {
new(cause: any, options: rp.Options, response: http.IncomingMessage): TransformError;
(cause: any, options: rp.Options, response: http.IncomingMessage): TransformError;
new(cause: any, options: rp.Options, response: rp.FullResponse): TransformError;
(cause: any, options: rp.Options, response: rp.FullResponse): TransformError;
prototype: TransformError;
}
export const TransformError: TransformErrorConstructor;