Copilot commented on code in PR #396:
URL: https://github.com/apache/dubbo-go-hessian2/pull/396#discussion_r3378646816


##########
java_exception/dubbo_generic_exception.go:
##########
@@ -30,12 +30,29 @@ type DubboGenericException struct {
 
 // NewDubboGenericException is the constructor
 func NewDubboGenericException(exceptionClass, exceptionMessage string) 
*DubboGenericException {
-       return &DubboGenericException{ExceptionClass: exceptionClass, 
ExceptionMessage: exceptionMessage}
+       return &DubboGenericException{
+               DetailMessage:    
formatDubboGenericExceptionMessage(exceptionClass, exceptionMessage),
+               ExceptionClass:   exceptionClass,
+               ExceptionMessage: exceptionMessage,
+       }

Review Comment:
   NewDubboGenericException doesn't initialize StackTrace to an empty slice, 
unlike the other exception constructors in this package. This can change 
serialization behavior (nil vs empty) and makes the constructed exception 
inconsistent with the rest of java_exception constructors (e.g., 
NewThrowable/NewException/NewArithmeticException all set StackTrace: 
[]StackTraceElement{}).



-- 
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