Snow-kal commented on code in PR #3183:
URL: https://github.com/apache/dubbo-go/pull/3183#discussion_r2740313483
##########
protocol/dubbo/impl/hessian.go:
##########
@@ -85,7 +86,11 @@ func marshalResponse(encoder *hessian.Encoder, p
DubboPackage) ([]byte, error) {
if response.Exception != nil { // throw error
_ = encoder.Encode(resWithException)
- if t, ok :=
response.Exception.(java_exception.Throwabler); ok {
+ if g, ok :=
response.Exception.(*hessian2.GenericException); ok {
+ _ =
encoder.Encode(java_exception.NewDubboGenericException(g.ExceptionClass,
g.ExceptionMessage))
+ } else if g, ok :=
response.Exception.(hessian2.GenericException); ok {
+ _ =
encoder.Encode(java_exception.NewDubboGenericException(g.ExceptionClass,
g.ExceptionMessage))
+ } else if t, ok :=
response.Exception.(java_exception.Throwabler); ok {
_ = encoder.Encode(t)
} else {
_ =
encoder.Encode(java_exception.NewThrowable(response.Exception.Error()))
Review Comment:
已修改,修改该之后的代码
```
switch ex := response.Exception.(type) {
case *hessian2.GenericException:
_ =
encoder.Encode(java_exception.NewDubboGenericException(ex.ExceptionClass,
ex.ExceptionMessage))
case hessian2.GenericException:
_ =
encoder.Encode(java_exception.NewDubboGenericException(ex.ExceptionClass,
ex.ExceptionMessage))
case java_exception.Throwabler:
_ = encoder.Encode(ex)
default:
_ =
encoder.Encode(java_exception.NewThrowable(response.Exception.Error()))
}
```
--
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]