You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "leno23 (via GitHub)" <gi...@apache.org> on 2026/06/09 04:55:47 UTC

[PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

leno23 opened a new pull request, #396:
URL: https://github.com/apache/dubbo-go-hessian2/pull/396

   ### Description
   
   Related to apache/dubbo-go#3361 and apache/dubbo-go#3378.
   
   This PR completes the hessian2-side part of moving Dubbo generic exception handling into dubbo-go-hessian2. `DubboGenericException` already carries `ExceptionClass` and `ExceptionMessage`; this change makes the constructor and `Error()` expose a stable detail message from those fields so callers do not need to duplicate message formatting in dubbo-go.
   
   The behavior remains compatible with decoded Java exceptions: when `DetailMessage` is already populated by decoding, `Error()` keeps returning that decoded detail. When it is empty, `Error()` falls back to the generic exception class/message formatting that dubbo-go previously implemented locally.
   
   ### Validation
   
   - `go test ./java_exception`
   - `go test . -run TestException`
   - `go test ./...`
   - `git diff --check`
   - local audit script (`OVERALL_EXIT=0`)
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

Posted by "CAICAIIs (via GitHub)" <gi...@apache.org>.
CAICAIIs commented on PR #396:
URL: https://github.com/apache/dubbo-go-hessian2/pull/396#issuecomment-4700588265

   pls fix ci 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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #396:
URL: https://github.com/apache/dubbo-go-hessian2/pull/396#discussion_r3379798639


##########
java_exception/dubbo_generic_exception_test.go:
##########
@@ -0,0 +1,79 @@
+/*

Review Comment:
   [P1] 当前 CI 在格式检查阶段失败:workflow 执行 `go fmt ./...` 和 `imports-formatter` 后,`git status` 显示 `java_exception/dubbo_generic_exception_test.go` 被修改。原因是这个新增测试文件的行尾/格式没有按 `gofmt` 结果提交;需要本地运行 `go fmt ./...`(或至少格式化该文件)并提交格式化后的内容,否则 `ubuntu-latest - Go1.25 - JDK8` 会继续阻塞合并。



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

Posted by "wyf027 (via GitHub)" <gi...@apache.org>.
wyf027 closed pull request #396: fix(java_exception): populate dubbo generic exception message
URL: https://github.com/apache/dubbo-go-hessian2/pull/396


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

Posted by "leno23 (via GitHub)" <gi...@apache.org>.
leno23 commented on code in PR #396:
URL: https://github.com/apache/dubbo-go-hessian2/pull/396#discussion_r3384965409


##########
java_exception/dubbo_generic_exception_test.go:
##########
@@ -0,0 +1,79 @@
+/*

Review Comment:
   已处理 review 和 CI 格式问题:补充了 `StackTrace` 初始化,并运行了 `go fmt ./...`、`go test ./java_exception`、`go test ./...`。新的 CI run 当前是 `action_required`,需要维护者批准后才会继续运行。



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

Posted by "leno23 (via GitHub)" <gi...@apache.org>.
leno23 commented on PR #396:
URL: https://github.com/apache/dubbo-go-hessian2/pull/396#issuecomment-4704222408

   Fixed the CI formatting failure by applying the imports-formatter result to `java_exception/dubbo_generic_exception_test.go`. Local validation passes: `go test ./java_exception`, `go test ./...`, and `git diff --check`.


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(java_exception): populate dubbo generic exception message [dubbo-go-hessian2]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on PR #396:
URL: https://github.com/apache/dubbo-go-hessian2/pull/396#issuecomment-4701442434

   @Snow-kal @xxs588   help review this and https://github.com/apache/dubbo-go-hessian2/pull/396


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org