@@ -178,8 +178,7 @@ C.open = function(allFields, openCallback0) {
178
178
function send ( Method ) {
179
179
// This can throw an exception if there's some problem with the
180
180
// 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 ) ;
183
182
}
184
183
185
184
function negotiate ( server , desired ) {
@@ -205,7 +204,12 @@ C.open = function(allFields, openCallback0) {
205
204
return ;
206
205
}
207
206
self . serverProperties = start . fields . serverProperties ;
208
- send ( defs . ConnectionStartOk ) ;
207
+ try {
208
+ send ( defs . ConnectionStartOk ) ;
209
+ } catch ( err ) {
210
+ bail ( err ) ;
211
+ return ;
212
+ }
209
213
wait ( afterStartOk ) ;
210
214
}
211
215
@@ -227,8 +231,13 @@ C.open = function(allFields, openCallback0) {
227
231
negotiate ( fields . channelMax , allFields . channelMax ) ;
228
232
tunedOptions . heartbeat =
229
233
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
+ }
232
241
expect ( defs . ConnectionOpenOk , onOpenOk ) ;
233
242
break ;
234
243
default :
0 commit comments