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