@@ -609,6 +609,55 @@ export class DnsError extends NodeError {
609609 }
610610}
611611
612+ export class ERR_OPTION_NOT_IMPLEMENTED extends NodeError {
613+ constructor ( name : string | symbol ) {
614+ if ( typeof name === 'symbol' ) {
615+ name = ( name as symbol ) . description ! ;
616+ }
617+ super (
618+ 'ERR_OPTION_NOT_IMPLEMENTED' ,
619+ `The ${ name } option is not implemented`
620+ ) ;
621+ }
622+ }
623+
624+ export class ERR_SOCKET_BAD_PORT extends NodeError {
625+ constructor ( name : string , port : any , allowZero : boolean ) {
626+ const operator = allowZero ? '>=' : '>' ;
627+ super (
628+ 'ERR_SOCKET_BAD_PORT' ,
629+ `${ name } should be ${ operator } 0 and < 65536. Received ${ typeof port } .`
630+ ) ;
631+ }
632+ }
633+
634+ export class EPIPE extends NodeError {
635+ constructor ( ) {
636+ super ( 'EPIPE' , 'This socket has been ended by the other party' ) ;
637+ }
638+ }
639+
640+ export class ERR_SOCKET_CLOSED_BEFORE_CONNECTION extends NodeError {
641+ constructor ( ) {
642+ super (
643+ 'ERR_SOCKET_CLOSED_BEFORE_CONNETION' ,
644+ 'Socket closed before connection established'
645+ ) ;
646+ }
647+ }
648+
649+ export class ERR_SOCKET_CLOSED extends NodeError {
650+ constructor ( ) {
651+ super ( 'ERR_SOCKET_CLOSED' , 'Socket is closed' ) ;
652+ }
653+ }
654+
655+ export class ERR_SOCKET_CONNECTING extends NodeError {
656+ constructor ( ) {
657+ super ( 'ERR_SOCKET_CONNECTING' , 'Socket is already connecting' ) ;
658+ }
659+ }
660+
612661export function aggregateTwoErrors ( innerError : any , outerError : any ) {
613662 if ( innerError && outerError && innerError !== outerError ) {
614663 if ( Array . isArray ( outerError . errors ) ) {
0 commit comments