Skip to content

Commit bb86f85

Browse files
jasnelladuh95
andauthored
[squash] nit
Co-authored-by: Antoine du Hamel <[email protected]>
1 parent 5edb1d1 commit bb86f85

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/internal/errors.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,14 +821,11 @@ function hideInternalStackFrames(error) {
821821
// to make usage of the error in userland and readable-stream easier.
822822
// It is a regular error with `.code` and `.name`.
823823
class AbortError extends Error {
824-
constructor(message = 'The operation was aborted', options = {}) {
825-
if (options === null || typeof options !== 'object') {
824+
constructor(message = 'The operation was aborted', options = undefined) {
825+
if (options !== undefined && typeof options !== 'object') {
826826
throw new codes.ERR_INVALID_ARG_TYPE('options', 'Object', options);
827827
}
828-
const {
829-
cause,
830-
} = options;
831-
super(message, { cause });
828+
super(message, options);
832829
this.code = 'ABORT_ERR';
833830
this.name = 'AbortError';
834831
}

0 commit comments

Comments
 (0)