@@ -1034,7 +1034,7 @@ function setupHandle(socket, type, options) {
10341034 // If the session has been destroyed, go ahead and emit 'connect',
10351035 // but do nothing else. The various on('connect') handlers set by
10361036 // 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.
10381038 if ( this . destroyed ) {
10391039 process . nextTick ( emit , this , 'connect' , this , socket ) ;
10401040 return ;
@@ -2126,7 +2126,7 @@ class Http2Stream extends Duplex {
21262126 }
21272127
21282128 [ 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 ' +
21302130 'bug in Node.js' ) ;
21312131 }
21322132
@@ -3380,8 +3380,13 @@ function connect(authority, options, listener) {
33803380ObjectDefineProperty ( connect , promisify . custom , {
33813381 __proto__ : null ,
33823382 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 ) ;
33853390 } ) ;
33863391 } ,
33873392} ) ;
0 commit comments