@@ -453,8 +453,13 @@ Connection.prototype.sasl_failed = function (text, condition) {
453
453
} ;
454
454
455
455
Connection . prototype . _is_fatal = function ( error_condition ) {
456
- var non_fatal = this . get_option ( 'non_fatal_errors' , [ 'amqp:connection:forced' ] ) ;
457
- return non_fatal . indexOf ( error_condition ) < 0 ;
456
+ var all_errors_non_fatal = this . get_option ( 'all_errors_non_fatal' , false ) ;
457
+ if ( all_errors_non_fatal ) {
458
+ return false ;
459
+ } else {
460
+ var non_fatal = this . get_option ( 'non_fatal_errors' , [ 'amqp:connection:forced' ] ) ;
461
+ return non_fatal . indexOf ( error_condition ) < 0 ;
462
+ }
458
463
} ;
459
464
460
465
Connection . prototype . _handle_error = function ( ) {
@@ -4270,19 +4275,22 @@ types.Reader.prototype.read = function () {
4270
4275
return constructor . descriptor ? types . described_nc ( constructor . descriptor , value ) : value ;
4271
4276
} ;
4272
4277
4273
- types . Reader . prototype . read_constructor = function ( ) {
4278
+ types . Reader . prototype . read_constructor = function ( descriptors ) {
4274
4279
var code = this . read_typecode ( ) ;
4275
4280
if ( code === 0x00 ) {
4276
- var d = [ ] ;
4277
- d . push ( this . read ( ) ) ;
4278
- var c = this . read_constructor ( ) ;
4279
- while ( c . descriptor ) {
4280
- d . push ( c . descriptor ) ;
4281
- c = this . read_constructor ( ) ;
4282
- }
4283
- return { 'typecode' : c . typecode , 'descriptor' : d . length === 1 ? d [ 0 ] : d } ;
4281
+ if ( descriptors === undefined ) {
4282
+ descriptors = [ ] ;
4283
+ }
4284
+ descriptors . push ( this . read ( ) ) ;
4285
+ return this . read_constructor ( descriptors ) ;
4284
4286
} else {
4285
- return { 'typecode' : code } ;
4287
+ if ( descriptors === undefined ) {
4288
+ return { 'typecode' : code } ;
4289
+ } else if ( descriptors . length === 1 ) {
4290
+ return { 'typecode' : code , 'descriptor' : descriptors [ 0 ] } ;
4291
+ } else {
4292
+ return { 'typecode' : code , 'descriptor' : descriptors [ 0 ] , 'descriptors' : descriptors } ;
4293
+ }
4286
4294
}
4287
4295
} ;
4288
4296
0 commit comments