Skip to content

Commit 888ecf3

Browse files
committed
fixup! lib: aggregate errors to avoid error swallowing
1 parent d7ab66c commit 888ecf3

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

doc/api/fs.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -2333,6 +2333,10 @@ error `UV_ENOSYS`.
23332333
<!-- YAML
23342334
deprecated: v0.4.7
23352335
changes:
2336+
- version: REPLACEME
2337+
pr-url: https://github.com./nodejs/node/pull/37460
2338+
description: The error returned may be an `AggregateError` if more than one
2339+
error is returned.
23362340
- version: v10.0.0
23372341
pr-url: https://github.com./nodejs/node/pull/12562
23382342
description: The `callback` parameter is no longer optional. Not passing
@@ -2346,7 +2350,7 @@ changes:
23462350
* `path` {string|Buffer|URL}
23472351
* `mode` {integer}
23482352
* `callback` {Function}
2349-
* `err` {Error}
2353+
* `err` {Error|AggregateError}
23502354
23512355
Changes the permissions on a symbolic link. No arguments other than a possible
23522356
exception are given to the completion callback.
@@ -2809,6 +2813,10 @@ If `options.withFileTypes` is set to `true`, the `files` array will contain
28092813
<!-- YAML
28102814
added: v0.1.29
28112815
changes:
2816+
- version: REPLACEME
2817+
pr-url: https://github.com./nodejs/node/pull/37460
2818+
description: The error returned may be an `AggregateError` if more than one
2819+
error is returned.
28122820
- version: v15.2.0
28132821
pr-url: https://github.com./nodejs/node/pull/35911
28142822
description: The options argument may include an AbortSignal to abort an
@@ -2840,7 +2848,7 @@ changes:
28402848
* `flag` {string} See [support of file system `flags`][]. **Default:** `'r'`.
28412849
* `signal` {AbortSignal} allows aborting an in-progress readFile
28422850
* `callback` {Function}
2843-
* `err` {Error}
2851+
* `err` {Error|AggregateError}
28442852
* `data` {string|Buffer}
28452853
28462854
Asynchronously reads the entire contents of a file.
@@ -3384,6 +3392,10 @@ example/
33843392
<!-- YAML
33853393
added: v0.8.6
33863394
changes:
3395+
- version: REPLACEME
3396+
pr-url: https://github.com./nodejs/node/pull/37460
3397+
description: The error returned may be an `AggregateError` if more than one
3398+
error is returned.
33873399
- version: v10.0.0
33883400
pr-url: https://github.com./nodejs/node/pull/12562
33893401
description: The `callback` parameter is no longer optional. Not passing
@@ -3397,7 +3409,7 @@ changes:
33973409
* `path` {string|Buffer|URL}
33983410
* `len` {integer} **Default:** `0`
33993411
* `callback` {Function}
3400-
* `err` {Error}
3412+
* `err` {Error|AggregateError}
34013413

34023414
Truncates the file. No arguments other than a possible exception are
34033415
given to the completion callback. A file descriptor can also be passed as the
@@ -3837,6 +3849,10 @@ details.
38373849
<!-- YAML
38383850
added: v0.1.29
38393851
changes:
3852+
- version: REPLACEME
3853+
pr-url: https://github.com./nodejs/node/pull/37460
3854+
description: The error returned may be an `AggregateError` if more than one
3855+
error is returned.
38403856
- version: v15.2.0
38413857
pr-url: https://github.com./nodejs/node/pull/35993
38423858
description: The options argument may include an AbortSignal to abort an
@@ -3877,7 +3893,7 @@ changes:
38773893
* `flag` {string} See [support of file system `flags`][]. **Default:** `'w'`.
38783894
* `signal` {AbortSignal} allows aborting an in-progress writeFile
38793895
* `callback` {Function}
3880-
* `err` {Error}
3896+
* `err` {Error|AggregateError}
38813897
38823898
When `file` is a filename, asynchronously writes data to the file, replacing the
38833899
file if it already exists. `data` can be a string or a buffer.

tools/doc/type-parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const jsPrimitives = {
1515

1616
const jsGlobalObjectsUrl = `${jsDocPrefix}Reference/Global_Objects/`;
1717
const jsGlobalTypes = [
18-
'Array', 'ArrayBuffer', 'DataView', 'Date', 'Error',
18+
'AggregateError', 'Array', 'ArrayBuffer', 'DataView', 'Date', 'Error',
1919
'EvalError', 'Function', 'Map', 'Object', 'Promise', 'RangeError',
2020
'ReferenceError', 'RegExp', 'Set', 'SharedArrayBuffer', 'SyntaxError',
2121
'TypeError', 'TypedArray', 'URIError', 'Uint8Array',

0 commit comments

Comments
 (0)