File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -525,9 +525,15 @@ func (client *Client) input() {
525
525
continue
526
526
}
527
527
case res .MessageStatusType () == protocol .Error :
528
- // We've got an error response. Give this to the request;
529
- call .Error = ServiceError (res .Metadata [protocol .ServiceError ])
530
- call .ResMetadata = res .Metadata
528
+ // We've got an error response. Give this to the request
529
+ if len (res .Metadata ) > 0 {
530
+ meta := make (map [string ]string , len (res .Metadata ))
531
+ for k , v := range res .Metadata {
532
+ meta [k ] = v
533
+ }
534
+ call .ResMetadata = meta
535
+ call .Error = ServiceError (meta [protocol .ServiceError ])
536
+ }
531
537
532
538
if call .Raw {
533
539
call .Metadata , call .Reply , _ = convertRes2Raw (res )
@@ -550,7 +556,14 @@ func (client *Client) input() {
550
556
}
551
557
}
552
558
}
553
- call .ResMetadata = res .Metadata
559
+ if len (res .Metadata ) > 0 {
560
+ meta := make (map [string ]string , len (res .Metadata ))
561
+ for k , v := range res .Metadata {
562
+ meta [k ] = v
563
+ }
564
+ call .ResMetadata = res .Metadata
565
+ }
566
+
554
567
}
555
568
556
569
call .done ()
You canโt perform that action at this time.
0 commit comments