File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ var PlainServer = function(callback) {
5757PlainServer . prototype . start = function ( response , hostname ) {
5858 var fields = extract ( response ) ;
5959 if ( fields . length !== 3 ) {
60- this . connection . sasl_failed ( 'Unexpected response in PLAIN, got ' + fields . length + ' fields, expected 3' ) ;
60+ return Promise . reject ( 'Unexpected response in PLAIN, got ' + fields . length + ' fields, expected 3' ) ;
6161 }
6262 var self = this ;
6363 return Promise . resolve ( this . callback ( fields [ 1 ] , fields [ 2 ] , hostname ) )
@@ -208,7 +208,11 @@ SaslServer.prototype.do_fail = function (e) {
208208 var frame = frames . sasl_frame ( frames . sasl_outcome ( { code : sasl_codes . SYS } ) ) ;
209209 this . transport . encode ( frame ) ;
210210 this . connection . output ( ) ;
211- this . connection . sasl_failed ( 'Sasl callback promise failed' + e , 'amqp:internal-error' ) ;
211+ try {
212+ this . connection . sasl_failed ( 'Sasl callback promise failed with ' + e , 'amqp:internal-error' ) ;
213+ } catch ( e ) {
214+ console . error ( 'Uncaught error: ' , e . message ) ;
215+ }
212216} ;
213217
214218SaslServer . prototype . has_writes_pending = function ( ) {
You can’t perform that action at this time.
0 commit comments