got 11.8.1 → 11.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/source/as-promise/create-rejection.d.ts +0 -0
- package/dist/source/as-promise/create-rejection.js +0 -0
- package/dist/source/as-promise/index.d.ts +0 -0
- package/dist/source/as-promise/index.js +1 -1
- package/dist/source/as-promise/normalize-arguments.d.ts +0 -0
- package/dist/source/as-promise/normalize-arguments.js +0 -0
- package/dist/source/as-promise/parse-body.d.ts +1 -1
- package/dist/source/as-promise/parse-body.js +0 -0
- package/dist/source/as-promise/types.d.ts +0 -0
- package/dist/source/as-promise/types.js +2 -0
- package/dist/source/core/calculate-retry-delay.d.ts +0 -0
- package/dist/source/core/calculate-retry-delay.js +0 -0
- package/dist/source/core/index.d.ts +1 -1
- package/dist/source/core/index.js +21 -4
- package/dist/source/core/utils/dns-ip-version.d.ts +0 -0
- package/dist/source/core/utils/dns-ip-version.js +0 -0
- package/dist/source/core/utils/get-body-size.d.ts +0 -0
- package/dist/source/core/utils/get-body-size.js +0 -0
- package/dist/source/core/utils/get-buffer.d.ts +0 -0
- package/dist/source/core/utils/get-buffer.js +0 -0
- package/dist/source/core/utils/is-form-data.d.ts +0 -0
- package/dist/source/core/utils/is-form-data.js +0 -0
- package/dist/source/core/utils/is-response-ok.d.ts +0 -0
- package/dist/source/core/utils/is-response-ok.js +0 -0
- package/dist/source/core/utils/options-to-url.d.ts +0 -0
- package/dist/source/core/utils/options-to-url.js +0 -0
- package/dist/source/core/utils/proxy-events.d.ts +0 -0
- package/dist/source/core/utils/proxy-events.js +0 -0
- package/dist/source/core/utils/timed-out.d.ts +0 -0
- package/dist/source/core/utils/timed-out.js +0 -0
- package/dist/source/core/utils/unhandle.d.ts +0 -0
- package/dist/source/core/utils/unhandle.js +0 -0
- package/dist/source/core/utils/url-to-options.d.ts +0 -0
- package/dist/source/core/utils/url-to-options.js +0 -0
- package/dist/source/core/utils/weakable-map.d.ts +0 -0
- package/dist/source/core/utils/weakable-map.js +0 -0
- package/dist/source/create.d.ts +0 -0
- package/dist/source/create.js +0 -0
- package/dist/source/index.d.ts +0 -0
- package/dist/source/index.js +0 -0
- package/dist/source/types.d.ts +22 -20
- package/dist/source/types.js +0 -0
- package/dist/source/utils/deep-freeze.d.ts +0 -0
- package/dist/source/utils/deep-freeze.js +0 -0
- package/dist/source/utils/deprecation-warning.d.ts +0 -0
- package/dist/source/utils/deprecation-warning.js +0 -0
- package/license +0 -0
- package/package.json +2 -2
- package/readme.md +11 -10
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -113,11 +113,11 @@ function asPromise(normalizedOptions) {
|
|
|
113
113
|
request._beforeError(new types_1.RequestError(error.message, error, request));
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
+
globalResponse = response;
|
|
116
117
|
if (!is_response_ok_1.isResponseOk(response)) {
|
|
117
118
|
request._beforeError(new types_1.HTTPError(response));
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
|
-
globalResponse = response;
|
|
121
121
|
resolve(request.options.resolveBodyOnly ? response.body : response);
|
|
122
122
|
});
|
|
123
123
|
const onError = (error) => {
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ResponseType, Response, ParseJsonFunction } from './types';
|
|
2
|
-
declare const parseBody: (response: Response, responseType: ResponseType, parseJson: ParseJsonFunction, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined) => unknown;
|
|
2
|
+
declare const parseBody: (response: Response, responseType: ResponseType, parseJson: ParseJsonFunction, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | undefined) => unknown;
|
|
3
3
|
export default parseBody;
|
|
File without changes
|
|
File without changes
|
|
@@ -21,6 +21,7 @@ class ParseError extends core_1.RequestError {
|
|
|
21
21
|
const { options } = response.request;
|
|
22
22
|
super(`${error.message} in "${options.url.toString()}"`, error, response.request);
|
|
23
23
|
this.name = 'ParseError';
|
|
24
|
+
this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_BODY_PARSE_FAILURE' : this.code;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
exports.ParseError = ParseError;
|
|
@@ -31,6 +32,7 @@ class CancelError extends core_1.RequestError {
|
|
|
31
32
|
constructor(request) {
|
|
32
33
|
super('Promise was canceled', {}, request);
|
|
33
34
|
this.name = 'CancelError';
|
|
35
|
+
this.code = 'ERR_CANCELED';
|
|
34
36
|
}
|
|
35
37
|
get isCanceled() {
|
|
36
38
|
return true;
|
|
File without changes
|
|
File without changes
|
|
@@ -952,7 +952,7 @@ An error to be thrown when a request fails.
|
|
|
952
952
|
Contains a `code` property with error class code, like `ECONNREFUSED`.
|
|
953
953
|
*/
|
|
954
954
|
export declare class RequestError extends Error {
|
|
955
|
-
code
|
|
955
|
+
code: string;
|
|
956
956
|
stack: string;
|
|
957
957
|
readonly options: NormalizedOptions;
|
|
958
958
|
readonly response?: Response;
|
|
@@ -29,7 +29,7 @@ const is_response_ok_1 = require("./utils/is-response-ok");
|
|
|
29
29
|
const deprecation_warning_1 = require("../utils/deprecation-warning");
|
|
30
30
|
const normalize_arguments_1 = require("../as-promise/normalize-arguments");
|
|
31
31
|
const calculate_retry_delay_1 = require("./calculate-retry-delay");
|
|
32
|
-
|
|
32
|
+
let globalDnsCache;
|
|
33
33
|
const kRequest = Symbol('request');
|
|
34
34
|
const kResponse = Symbol('response');
|
|
35
35
|
const kResponseSize = Symbol('responseSize');
|
|
@@ -121,11 +121,11 @@ Contains a `code` property with error class code, like `ECONNREFUSED`.
|
|
|
121
121
|
*/
|
|
122
122
|
class RequestError extends Error {
|
|
123
123
|
constructor(message, error, self) {
|
|
124
|
-
var _a;
|
|
124
|
+
var _a, _b;
|
|
125
125
|
super(message);
|
|
126
126
|
Error.captureStackTrace(this, this.constructor);
|
|
127
127
|
this.name = 'RequestError';
|
|
128
|
-
this.code = error.code;
|
|
128
|
+
this.code = (_a = error.code) !== null && _a !== void 0 ? _a : 'ERR_GOT_REQUEST_ERROR';
|
|
129
129
|
if (self instanceof Request) {
|
|
130
130
|
Object.defineProperty(this, 'request', {
|
|
131
131
|
enumerable: false,
|
|
@@ -150,7 +150,7 @@ class RequestError extends Error {
|
|
|
150
150
|
value: self
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
this.timings = (
|
|
153
|
+
this.timings = (_b = this.request) === null || _b === void 0 ? void 0 : _b.timings;
|
|
154
154
|
// Recover the original stacktrace
|
|
155
155
|
if (is_1.default.string(error.stack) && is_1.default.string(this.stack)) {
|
|
156
156
|
const indexOfMessage = this.stack.indexOf(this.message) + this.message.length;
|
|
@@ -173,6 +173,7 @@ class MaxRedirectsError extends RequestError {
|
|
|
173
173
|
constructor(request) {
|
|
174
174
|
super(`Redirected ${request.options.maxRedirects} times. Aborting.`, {}, request);
|
|
175
175
|
this.name = 'MaxRedirectsError';
|
|
176
|
+
this.code = 'ERR_TOO_MANY_REDIRECTS';
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
exports.MaxRedirectsError = MaxRedirectsError;
|
|
@@ -184,6 +185,7 @@ class HTTPError extends RequestError {
|
|
|
184
185
|
constructor(response) {
|
|
185
186
|
super(`Response code ${response.statusCode} (${response.statusMessage})`, {}, response.request);
|
|
186
187
|
this.name = 'HTTPError';
|
|
188
|
+
this.code = 'ERR_NON_2XX_3XX_RESPONSE';
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
exports.HTTPError = HTTPError;
|
|
@@ -195,6 +197,7 @@ class CacheError extends RequestError {
|
|
|
195
197
|
constructor(error, request) {
|
|
196
198
|
super(error.message, error, request);
|
|
197
199
|
this.name = 'CacheError';
|
|
200
|
+
this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_CACHE_ACCESS' : this.code;
|
|
198
201
|
}
|
|
199
202
|
}
|
|
200
203
|
exports.CacheError = CacheError;
|
|
@@ -205,6 +208,7 @@ class UploadError extends RequestError {
|
|
|
205
208
|
constructor(error, request) {
|
|
206
209
|
super(error.message, error, request);
|
|
207
210
|
this.name = 'UploadError';
|
|
211
|
+
this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_UPLOAD' : this.code;
|
|
208
212
|
}
|
|
209
213
|
}
|
|
210
214
|
exports.UploadError = UploadError;
|
|
@@ -228,6 +232,7 @@ class ReadError extends RequestError {
|
|
|
228
232
|
constructor(error, request) {
|
|
229
233
|
super(error.message, error, request);
|
|
230
234
|
this.name = 'ReadError';
|
|
235
|
+
this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_READING_RESPONSE_STREAM' : this.code;
|
|
231
236
|
}
|
|
232
237
|
}
|
|
233
238
|
exports.ReadError = ReadError;
|
|
@@ -238,6 +243,7 @@ class UnsupportedProtocolError extends RequestError {
|
|
|
238
243
|
constructor(options) {
|
|
239
244
|
super(`Unsupported protocol "${options.url.protocol}"`, {}, options);
|
|
240
245
|
this.name = 'UnsupportedProtocolError';
|
|
246
|
+
this.code = 'ERR_UNSUPPORTED_PROTOCOL';
|
|
241
247
|
}
|
|
242
248
|
}
|
|
243
249
|
exports.UnsupportedProtocolError = UnsupportedProtocolError;
|
|
@@ -586,6 +592,9 @@ class Request extends stream_1.Duplex {
|
|
|
586
592
|
options.cacheOptions = { ...options.cacheOptions };
|
|
587
593
|
// `options.dnsCache`
|
|
588
594
|
if (options.dnsCache === true) {
|
|
595
|
+
if (!globalDnsCache) {
|
|
596
|
+
globalDnsCache = new cacheable_lookup_1.default();
|
|
597
|
+
}
|
|
589
598
|
options.dnsCache = globalDnsCache;
|
|
590
599
|
}
|
|
591
600
|
else if (!is_1.default.undefined(options.dnsCache) && !options.dnsCache.lookup) {
|
|
@@ -857,6 +866,14 @@ class Request extends stream_1.Duplex {
|
|
|
857
866
|
const redirectUrl = new url_1.URL(redirectBuffer, url);
|
|
858
867
|
const redirectString = redirectUrl.toString();
|
|
859
868
|
decodeURI(redirectString);
|
|
869
|
+
// eslint-disable-next-line no-inner-declarations
|
|
870
|
+
function isUnixSocketURL(url) {
|
|
871
|
+
return url.protocol === 'unix:' || url.hostname === 'unix';
|
|
872
|
+
}
|
|
873
|
+
if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) {
|
|
874
|
+
this._beforeError(new RequestError('Cannot redirect to UNIX socket', {}, this));
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
860
877
|
// Redirecting to a different site, clear sensitive data.
|
|
861
878
|
if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {
|
|
862
879
|
if ('host' in options.headers) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/source/create.d.ts
CHANGED
|
File without changes
|
package/dist/source/create.js
CHANGED
|
File without changes
|
package/dist/source/index.d.ts
CHANGED
|
File without changes
|
package/dist/source/index.js
CHANGED
|
File without changes
|
package/dist/source/types.d.ts
CHANGED
|
@@ -90,6 +90,14 @@ export declare type OptionsWithPagination<T = unknown, R = unknown> = Merge<Opti
|
|
|
90
90
|
An instance of `got.paginate`.
|
|
91
91
|
*/
|
|
92
92
|
export interface GotPaginate {
|
|
93
|
+
/**
|
|
94
|
+
Same as `GotPaginate.each`.
|
|
95
|
+
*/
|
|
96
|
+
<T, R = unknown>(url: string | URL, options?: OptionsWithPagination<T, R>): AsyncIterableIterator<T>;
|
|
97
|
+
/**
|
|
98
|
+
Same as `GotPaginate.each`.
|
|
99
|
+
*/
|
|
100
|
+
<T, R = unknown>(options?: OptionsWithPagination<T, R>): AsyncIterableIterator<T>;
|
|
93
101
|
/**
|
|
94
102
|
Returns an async iterator.
|
|
95
103
|
|
|
@@ -133,14 +141,6 @@ export interface GotPaginate {
|
|
|
133
141
|
```
|
|
134
142
|
*/
|
|
135
143
|
all: (<T, R = unknown>(url: string | URL, options?: OptionsWithPagination<T, R>) => Promise<T[]>) & (<T, R = unknown>(options?: OptionsWithPagination<T, R>) => Promise<T[]>);
|
|
136
|
-
/**
|
|
137
|
-
Same as `GotPaginate.each`.
|
|
138
|
-
*/
|
|
139
|
-
<T, R = unknown>(url: string | URL, options?: OptionsWithPagination<T, R>): AsyncIterableIterator<T>;
|
|
140
|
-
/**
|
|
141
|
-
Same as `GotPaginate.each`.
|
|
142
|
-
*/
|
|
143
|
-
<T, R = unknown>(options?: OptionsWithPagination<T, R>): AsyncIterableIterator<T>;
|
|
144
144
|
}
|
|
145
145
|
export interface GotRequestFunction {
|
|
146
146
|
(url: string | URL, options?: OptionsOfTextResponseBody): CancelableRequest<Response<string>>;
|
|
@@ -226,49 +226,51 @@ export interface Got extends Record<HTTPAlias, GotRequestFunction>, GotRequestFu
|
|
|
226
226
|
*/
|
|
227
227
|
defaults: InstanceDefaults;
|
|
228
228
|
/**
|
|
229
|
-
An error to be thrown when a cache method fails.
|
|
230
|
-
|
|
229
|
+
An error to be thrown when a cache method fails. For example, if the database goes down or there's a filesystem error.
|
|
230
|
+
Contains a `code` property with `ERR_CACHE_ACCESS` or a more specific failure code.
|
|
231
231
|
*/
|
|
232
232
|
CacheError: typeof CacheError;
|
|
233
233
|
/**
|
|
234
|
-
An error to be thrown when a request fails.
|
|
235
|
-
|
|
234
|
+
An error to be thrown when a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`.
|
|
235
|
+
If there is no specific code supplied, `code` defaults to `ERR_GOT_REQUEST_ERROR`.
|
|
236
236
|
*/
|
|
237
237
|
RequestError: typeof RequestError;
|
|
238
238
|
/**
|
|
239
|
-
An error to be thrown when reading from response stream fails.
|
|
239
|
+
An error to be thrown when reading from response stream fails. Contains a `code` property with
|
|
240
|
+
`ERR_READING_RESPONSE_STREAM` or a more specific failure code.
|
|
240
241
|
*/
|
|
241
242
|
ReadError: typeof ReadError;
|
|
242
243
|
/**
|
|
243
|
-
An error to be thrown when server response code is 2xx, and parsing body fails.
|
|
244
|
-
|
|
244
|
+
An error to be thrown when server response code is 2xx, and parsing body fails. Includes a
|
|
245
|
+
`response` property. Contains a `code` property with `ERR_BODY_PARSE_FAILURE` or a more specific failure code.
|
|
245
246
|
*/
|
|
246
247
|
ParseError: typeof ParseError;
|
|
247
248
|
/**
|
|
248
249
|
An error to be thrown when the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304.
|
|
249
|
-
Includes a `response` property.
|
|
250
|
+
Includes a `response` property. Contains a `code` property with `ERR_NON_2XX_3XX_RESPONSE` or a more specific failure code.
|
|
250
251
|
*/
|
|
251
252
|
HTTPError: typeof HTTPError;
|
|
252
253
|
/**
|
|
253
254
|
An error to be thrown when the server redirects you more than ten times.
|
|
254
|
-
Includes a `response` property.
|
|
255
|
+
Includes a `response` property. Contains a `code` property with `ERR_TOO_MANY_REDIRECTS`.
|
|
255
256
|
*/
|
|
256
257
|
MaxRedirectsError: typeof MaxRedirectsError;
|
|
257
258
|
/**
|
|
258
|
-
An error to be thrown when given an unsupported protocol.
|
|
259
|
+
An error to be thrown when given an unsupported protocol. Contains a `code` property with `ERR_UNSUPPORTED_PROTOCOL`.
|
|
259
260
|
*/
|
|
260
261
|
UnsupportedProtocolError: typeof UnsupportedProtocolError;
|
|
261
262
|
/**
|
|
262
263
|
An error to be thrown when the request is aborted due to a timeout.
|
|
263
|
-
Includes an `event` and `timings` property.
|
|
264
|
+
Includes an `event` and `timings` property. Contains a `code` property with `ETIMEDOUT`.
|
|
264
265
|
*/
|
|
265
266
|
TimeoutError: typeof TimeoutError;
|
|
266
267
|
/**
|
|
267
268
|
An error to be thrown when the request body is a stream and an error occurs while reading from that stream.
|
|
269
|
+
Contains a `code` property with `ERR_UPLOAD` or a more specific failure code.
|
|
268
270
|
*/
|
|
269
271
|
UploadError: typeof UploadError;
|
|
270
272
|
/**
|
|
271
|
-
An error to be thrown when the request is aborted with `.cancel()`.
|
|
273
|
+
An error to be thrown when the request is aborted with `.cancel()`. Contains a `code` property with `ERR_CANCELED`.
|
|
272
274
|
*/
|
|
273
275
|
CancelError: typeof CancelError;
|
|
274
276
|
/**
|
package/dist/source/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/license
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "got",
|
|
3
|
-
"version": "11.8.
|
|
3
|
+
"version": "11.8.5",
|
|
4
4
|
"description": "Human-friendly and powerful HTTP request library for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/got",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/cacheable-request": "^6.0.1",
|
|
49
49
|
"@types/responselike": "^1.0.0",
|
|
50
50
|
"cacheable-lookup": "^5.0.3",
|
|
51
|
-
"cacheable-request": "^7.0.
|
|
51
|
+
"cacheable-request": "^7.0.2",
|
|
52
52
|
"decompress-response": "^6.0.0",
|
|
53
53
|
"http2-wrapper": "^1.0.0-beta.5.2",
|
|
54
54
|
"lowercase-keys": "^2.0.0",
|
package/readme.md
CHANGED
|
@@ -1705,43 +1705,44 @@ Additionaly, the errors may have `request` (Got Stream) and `response` (Got Resp
|
|
|
1705
1705
|
|
|
1706
1706
|
#### got.RequestError
|
|
1707
1707
|
|
|
1708
|
-
When a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`. All the errors below inherit this one.
|
|
1708
|
+
When a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`. If there is no specific code supplied, `code` defaults to `ERR_GOT_REQUEST_ERROR`. All the errors below inherit this one.
|
|
1709
1709
|
|
|
1710
1710
|
#### got.CacheError
|
|
1711
1711
|
|
|
1712
|
-
When a cache method fails, for example, if the database goes down or there's a filesystem error.
|
|
1712
|
+
When a cache method fails, for example, if the database goes down or there's a filesystem error. Contains a `code` property with `ERR_CACHE_ACCESS` or a more specific failure code.
|
|
1713
1713
|
|
|
1714
1714
|
#### got.ReadError
|
|
1715
1715
|
|
|
1716
|
-
When reading from response stream fails.
|
|
1716
|
+
When reading from response stream fails. Contains a `code` property with `ERR_READING_RESPONSE_STREAM` or a more specific failure code.
|
|
1717
1717
|
|
|
1718
1718
|
#### got.ParseError
|
|
1719
1719
|
|
|
1720
|
-
When server response code is 2xx, and parsing body fails. Includes a `response` property.
|
|
1720
|
+
When server response code is 2xx, and parsing body fails. Includes a `response` property. Contains a `code` property with `ERR_BODY_PARSE_FAILURE` or a more specific failure code.
|
|
1721
1721
|
|
|
1722
1722
|
#### got.UploadError
|
|
1723
1723
|
|
|
1724
|
-
When the request body is a stream and an error occurs while reading from that stream.
|
|
1724
|
+
When the request body is a stream and an error occurs while reading from that stream. Contains a `code` property with `ERR_UPLOAD` or a more specific failure code.
|
|
1725
1725
|
|
|
1726
1726
|
#### got.HTTPError
|
|
1727
1727
|
|
|
1728
|
-
When the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304. Includes a `response` property.
|
|
1728
|
+
When the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304. Includes a `response` property. Contains a `code` property with `ERR_NON_2XX_3XX_RESPONSE` or a more specific failure code.
|
|
1729
|
+
|
|
1729
1730
|
|
|
1730
1731
|
#### got.MaxRedirectsError
|
|
1731
1732
|
|
|
1732
|
-
When the server redirects you more than ten times. Includes a `response` property.
|
|
1733
|
+
When the server redirects you more than ten times. Includes a `response` property. Contains a `code` property with `ERR_TOO_MANY_REDIRECTS`.
|
|
1733
1734
|
|
|
1734
1735
|
#### got.UnsupportedProtocolError
|
|
1735
1736
|
|
|
1736
|
-
When given an unsupported protocol.
|
|
1737
|
+
When given an unsupported protocol. Contains a `code` property with `ERR_UNSUPPORTED_PROTOCOL`.
|
|
1737
1738
|
|
|
1738
1739
|
#### got.TimeoutError
|
|
1739
1740
|
|
|
1740
|
-
When the request is aborted due to a [timeout](#timeout). Includes an `event` and `timings` property.
|
|
1741
|
+
When the request is aborted due to a [timeout](#timeout). Includes an `event` and `timings` property. Contains a `code` property with `ETIMEDOUT`.
|
|
1741
1742
|
|
|
1742
1743
|
#### got.CancelError
|
|
1743
1744
|
|
|
1744
|
-
When the request is aborted with `.cancel()`.
|
|
1745
|
+
When the request is aborted with `.cancel()`. Contains a `code` property with `ERR_CANCELED`.
|
|
1745
1746
|
|
|
1746
1747
|
## Aborting the request
|
|
1747
1748
|
|