@@ -842,7 +842,7 @@ E('ERR_STREAM_UNSHIFT_AFTER_END_EVENT',
842
842
'stream.unshift() after end event' , Error ) ;
843
843
E ( 'ERR_STREAM_WRAP' , 'Stream has StringDecoder set or is in objectMode' , Error ) ;
844
844
E ( 'ERR_STREAM_WRITE_AFTER_END' , 'write after end' , Error ) ;
845
- E ( 'ERR_SYSTEM_ERROR' , sysError ( 'A system error occurred' ) ) ;
845
+ E ( 'ERR_SYSTEM_ERROR' , sysError ) ;
846
846
E ( 'ERR_TLS_CERT_ALTNAME_INVALID' ,
847
847
'Hostname/IP does not match certificate\'s altnames: %s' , Error ) ;
848
848
E ( 'ERR_TLS_DH_PARAM_SIZE' , 'DH parameter size %s is less than 2048' , Error ) ;
@@ -903,26 +903,21 @@ E('ERR_VM_MODULE_STATUS', 'Module status %s', Error);
903
903
E ( 'ERR_ZLIB_BINDING_CLOSED' , 'zlib binding closed' , Error ) ;
904
904
E ( 'ERR_ZLIB_INITIALIZATION_FAILED' , 'Initialization failed' , Error ) ;
905
905
906
- function sysError ( defaultMessage ) {
907
- return function ( code ,
908
- syscall ,
909
- path ,
910
- dest ,
911
- message = defaultMessage ) {
912
- if ( code !== undefined )
913
- message += `: ${ code } ` ;
914
- if ( syscall !== undefined ) {
915
- if ( code === undefined )
916
- message += ':' ;
917
- message += ` [${ syscall } ]` ;
918
- }
919
- if ( path !== undefined ) {
920
- message += `: ${ path } ` ;
921
- if ( dest !== undefined )
922
- message += ` => ${ dest } ` ;
923
- }
924
- return message ;
925
- } ;
906
+ function sysError ( code , syscall , path , dest ,
907
+ message = 'A system error occurred' ) {
908
+ if ( code !== undefined )
909
+ message += `: ${ code } ` ;
910
+ if ( syscall !== undefined ) {
911
+ if ( code === undefined )
912
+ message += ':' ;
913
+ message += ` [${ syscall } ]` ;
914
+ }
915
+ if ( path !== undefined ) {
916
+ message += `: ${ path } ` ;
917
+ if ( dest !== undefined )
918
+ message += ` => ${ dest } ` ;
919
+ }
920
+ return message ;
926
921
}
927
922
928
923
function invalidArgType ( name , expected , actual ) {
0 commit comments