diff options
author | Yuchen Pei <hi@ypei.me> | 2022-07-28 15:32:10 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-07-28 15:32:10 +1000 |
commit | 5b10a10743b8459f64fe83e0ff420f69da79c9a4 (patch) | |
tree | c61904d688247790181d4955a4074b8c94302c03 /hash_script/node_modules/node-fetch/ERROR-HANDLING.md | |
parent | b98cb70b1bcd5b211aaa5d2675f96416911c0647 (diff) |
Moving scripts and utilities into a new utilities dir
Diffstat (limited to 'hash_script/node_modules/node-fetch/ERROR-HANDLING.md')
-rw-r--r-- | hash_script/node_modules/node-fetch/ERROR-HANDLING.md | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/hash_script/node_modules/node-fetch/ERROR-HANDLING.md b/hash_script/node_modules/node-fetch/ERROR-HANDLING.md deleted file mode 100644 index 0e4025d..0000000 --- a/hash_script/node_modules/node-fetch/ERROR-HANDLING.md +++ /dev/null @@ -1,21 +0,0 @@ - -Error handling with node-fetch -============================== - -Because `window.fetch` isn't designed to transparent about the cause of request errors, we have to come up with our own solutions. - -The basics: - -- All [operational errors](https://www.joyent.com/node-js/production/design/errors) are rejected as [FetchError](https://github.com/bitinn/node-fetch/blob/master/lib/fetch-error.js), you can handle them all through promise `catch` clause. - -- All errors comes with `err.message` detailing the cause of errors. - -- All errors originated from `node-fetch` are marked with custom `err.type`. - -- All errors originated from Node.js core are marked with `err.type = system`, and contains addition `err.code` and `err.errno` for error handling, they are alias to error codes thrown by Node.js core. - -- [Programmer errors](https://www.joyent.com/node-js/production/design/errors) are either thrown as soon as possible, or rejected with default `Error` with `err.message` for ease of troubleshooting. - -List of error types: - -- Because we maintain 100% coverage, see [test.js](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for a full list of custom `FetchError` types, as well as some of the common errors from Node.js |