@@ -1034,7 +1034,7 @@ function setupHandle(socket, type, options) {
1034
1034
// If the session has been destroyed, go ahead and emit 'connect',
1035
1035
// but do nothing else. The various on('connect') handlers set by
1036
1036
// core will check for session.destroyed before progressing, this
1037
- // ensures that those at l`east get cleared out.
1037
+ // ensures that those at least get cleared out.
1038
1038
if ( this . destroyed ) {
1039
1039
process . nextTick ( emit , this , 'connect' , this , socket ) ;
1040
1040
return ;
@@ -2126,7 +2126,7 @@ class Http2Stream extends Duplex {
2126
2126
}
2127
2127
2128
2128
[ kProceed ] ( ) {
2129
- assert . fail ( 'Implementors MUST implement this. Please report this as a ' +
2129
+ assert . fail ( 'Implementers MUST implement this. Please report this as a ' +
2130
2130
'bug in Node.js' ) ;
2131
2131
}
2132
2132
@@ -3380,8 +3380,13 @@ function connect(authority, options, listener) {
3380
3380
ObjectDefineProperty ( connect , promisify . custom , {
3381
3381
__proto__ : null ,
3382
3382
value : ( authority , options ) => {
3383
- return new Promise ( ( resolve ) => {
3384
- const server = connect ( authority , options , ( ) => resolve ( server ) ) ;
3383
+ return new Promise ( ( resolve , reject ) => {
3384
+ const server = connect ( authority , options , ( ) => {
3385
+ server . removeListener ( 'error' , reject ) ;
3386
+ return resolve ( server ) ;
3387
+ } ) ;
3388
+
3389
+ server . once ( 'error' , reject ) ;
3385
3390
} ) ;
3386
3391
} ,
3387
3392
} ) ;
0 commit comments