@@ -178,8 +178,7 @@ C.open = function(allFields, openCallback0) {
178178 function send ( Method ) {
179179 // This can throw an exception if there's some problem with the
180180 // options; e.g., something is a string instead of a number.
181- try { self . sendMethod ( 0 , Method , tunedOptions ) ; }
182- catch ( err ) { bail ( err ) ; }
181+ self . sendMethod ( 0 , Method , tunedOptions ) ;
183182 }
184183
185184 function negotiate ( server , desired ) {
@@ -205,7 +204,12 @@ C.open = function(allFields, openCallback0) {
205204 return ;
206205 }
207206 self . serverProperties = start . fields . serverProperties ;
208- send ( defs . ConnectionStartOk ) ;
207+ try {
208+ send ( defs . ConnectionStartOk ) ;
209+ } catch ( err ) {
210+ bail ( err ) ;
211+ return ;
212+ }
209213 wait ( afterStartOk ) ;
210214 }
211215
@@ -227,8 +231,13 @@ C.open = function(allFields, openCallback0) {
227231 negotiate ( fields . channelMax , allFields . channelMax ) ;
228232 tunedOptions . heartbeat =
229233 negotiate ( fields . heartbeat , allFields . heartbeat ) ;
230- send ( defs . ConnectionTuneOk ) ;
231- send ( defs . ConnectionOpen ) ;
234+ try {
235+ send ( defs . ConnectionTuneOk ) ;
236+ send ( defs . ConnectionOpen ) ;
237+ } catch ( err ) {
238+ bail ( err ) ;
239+ return ;
240+ }
232241 expect ( defs . ConnectionOpenOk , onOpenOk ) ;
233242 break ;
234243 default :
0 commit comments