fix(java_exception): populate dubbo generic exception message#396
Open
leno23 wants to merge 3 commits into
Open
fix(java_exception): populate dubbo generic exception message#396leno23 wants to merge 3 commits into
leno23 wants to merge 3 commits into
Conversation
3 tasks
There was a problem hiding this comment.
Pull request overview
This PR updates DubboGenericException to expose a stable error detail message derived from ExceptionClass/ExceptionMessage when DetailMessage is not already populated (e.g., by decoding), so downstream callers don’t need to duplicate formatting logic.
Changes:
- Populate
DetailMessageinNewDubboGenericExceptionusing a shared message formatter. - Update
DubboGenericException.Error()to prefer decodedDetailMessage, with a fallback to formatted class/message. - Add unit tests covering constructor behavior and
Error()fallback/preference rules.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| java_exception/dubbo_generic_exception.go | Sets/derives a stable error message for DubboGenericException via constructor + Error() fallback formatting. |
| java_exception/dubbo_generic_exception_test.go | Adds tests verifying message formatting, fallback behavior, and decoded detail preference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AlexStocks
reviewed
Jun 9, 2026
|
pls fix ci error |
Member
2 tasks
Author
|
Fixed the CI formatting failure by applying the imports-formatter result to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
DubboGenericExceptionalready carriesExceptionClassandExceptionMessage; this change makes the constructor andError()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
DetailMessageis 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_exceptiongo test . -run TestExceptiongo test ./...git diff --checkOVERALL_EXIT=0)