Copilot commented on code in PR #3574:
URL: https://github.com/apache/dubbo-go/pull/3574#discussion_r3726215226


##########
protocol/dubbo/hessian2/hessian_request_test.go:
##########
@@ -90,6 +90,39 @@ func TestPackRequest(t *testing.T) {
        }
 }
 
+func TestPackRequestReturnsEncodeErrors(t *testing.T) {
+       tests := []struct {
+               name    string
+               request *DubboRequest
+       }{
+               {
+                       name: "unsupported argument",
+                       request: NewRequest([]any{
+                               map[complex64]string{1 + 2i: "value"},
+                       }, nil),
+               },

Review Comment:
   The "unsupported argument" case may not reliably trigger an encode error 
(depending on Hessian2 encoder support for complex keys), which can make this 
regression test flaky. Using an obviously unsupported value (e.g., a func) 
makes the intent deterministic.



##########
remoting/polaris/parser/parser.go:
##########
@@ -88,7 +88,10 @@ func ParseArgumentsByExpression(key string, parameters 
[]any) any {
                return nil
        }
        var searchVal any
-       _ = json.Unmarshal(data, &searchVal)
+       if err = json.Unmarshal(data, &searchVal); err != nil {
+               logger.Errorf("[Remoting][Polaris] unmarshal parameter %+v 
fail, err=%v", parameters[index], err)
+               return nil
+       }

Review Comment:
   The new log message uses "fail" instead of the past tense "failed", which 
reads as a grammatical error and is inconsistent with common error logging 
phrasing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to