File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -821,14 +821,11 @@ function hideInternalStackFrames(error) {
821
821
// to make usage of the error in userland and readable-stream easier.
822
822
// It is a regular error with `.code` and `.name`.
823
823
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' ) {
826
826
throw new codes . ERR_INVALID_ARG_TYPE ( 'options' , 'Object' , options ) ;
827
827
}
828
- const {
829
- cause,
830
- } = options ;
831
- super ( message , { cause } ) ;
828
+ super ( message , options ) ;
832
829
this . code = 'ABORT_ERR' ;
833
830
this . name = 'AbortError' ;
834
831
}
You can’t perform that action at this time.
0 commit comments