@@ -558,11 +558,7 @@ func queryWorkflowHelper(c *cli.Context, queryType string) {
558
558
if queryResponse .QueryRejected != nil {
559
559
fmt .Printf ("Query was rejected, workflow has status: %v\n " , queryResponse .QueryRejected .GetStatus ())
560
560
} else {
561
- var queryResult string
562
- err = payloads .Decode (queryResponse .QueryResult , & queryResult )
563
- if err != nil {
564
- ErrorAndExit ("Unable to decode query result." , err )
565
- }
561
+ queryResult := payloads .ToString (queryResponse .QueryResult )
566
562
fmt .Printf ("Query result:\n %v\n " , queryResult )
567
563
}
568
564
}
@@ -1086,11 +1082,7 @@ func printRunStatus(event *historypb.HistoryEvent) {
1086
1082
switch event .GetEventType () {
1087
1083
case enumspb .EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED :
1088
1084
fmt .Printf (" Status: %s\n " , colorGreen ("COMPLETED" ))
1089
- var result string
1090
- err := payloads .Decode (event .GetWorkflowExecutionCompletedEventAttributes ().GetResult (), & result )
1091
- if err != nil {
1092
- ErrorAndExit ("Unable ot decode WorkflowExecutionCompletedEventAttributes.Result." , err )
1093
- }
1085
+ result := payloads .ToString (event .GetWorkflowExecutionCompletedEventAttributes ().GetResult ())
1094
1086
fmt .Printf (" Output: %s\n " , result )
1095
1087
case enumspb .EVENT_TYPE_WORKFLOW_EXECUTION_FAILED :
1096
1088
fmt .Printf (" Status: %s\n " , colorRed ("FAILED" ))
@@ -1100,11 +1092,7 @@ func printRunStatus(event *historypb.HistoryEvent) {
1100
1092
fmt .Printf (" Retry status: %s\n " , event .GetWorkflowExecutionTimedOutEventAttributes ().GetRetryState ())
1101
1093
case enumspb .EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED :
1102
1094
fmt .Printf (" Status: %s\n " , colorRed ("CANCELED" ))
1103
- var details string
1104
- err := payloads .Decode (event .GetWorkflowExecutionCanceledEventAttributes ().GetDetails (), & details )
1105
- if err != nil {
1106
- ErrorAndExit ("Unable ot decode WorkflowExecutionCanceledEventAttributes.Details." , err )
1107
- }
1095
+ details := payloads .ToString (event .GetWorkflowExecutionCanceledEventAttributes ().GetDetails ())
1108
1096
fmt .Printf (" Detail: %s\n " , details )
1109
1097
}
1110
1098
}
0 commit comments