@@ -453,8 +453,13 @@ Connection.prototype.sasl_failed = function (text, condition) {
453453} ;
454454
455455Connection . 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+ }
458463} ;
459464
460465Connection . prototype . _handle_error = function ( ) {
@@ -4270,19 +4275,22 @@ types.Reader.prototype.read = function () {
42704275 return constructor . descriptor ? types . described_nc ( constructor . descriptor , value ) : value ;
42714276} ;
42724277
4273- types . Reader . prototype . read_constructor = function ( ) {
4278+ types . Reader . prototype . read_constructor = function ( descriptors ) {
42744279 var code = this . read_typecode ( ) ;
42754280 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 ) ;
42844286 } 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+ }
42864294 }
42874295} ;
42884296
0 commit comments