-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ftr: catch exceptions that user defined #208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a unit test for it pls
@cvictory can u add a unit test that the exception data is from java, there are many ut samples in this project which decode bytes generated by java. |
增加了java的异常返回结果的用例,数据存在test_reource目录下的两个文件。 |
test_resource/RuntimeException.txt
Outdated
@@ -0,0 +1,5 @@ | |||
Cjava.lang.RuntimeException�detailMessagecause | |||
stackTracesuppressedExceptions`test exceptQ�V[java.lang.StackTraceElement�?Cjava.lang.StackTraceElement�declaringClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why display not normal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
存储在里面是以byte数组形式。
@cvictory sorry for delay reply. DO NOT add binary data into, which can't be checked, u can test java response easily, ref https://github.com/apache/dubbo-go-hessian2/blob/master/decode_test.go#L93 |
"github.com/apache/dubbo-go-hessian2/java_exception" | ||
) | ||
|
||
var mutex sync.Mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think should make this variable name more meaningful, like getExceptionMutex
, checkExceptionMutex
etc?
add support java8 time object. apache#212, apache#221
add catch user defined exceptions. #208
Ftr: catch exceptions that user defined
add catch user defined exceptions. #208
1.当java抛出自定义业务异常的时候,当dubb-go client没有注册这个异常类型,这时候会出现错误。
这里会将这种异常统一转换为BizException。
2.原来的stackTraceElement数据丢失,进行修复。
之前的pr : #204 ,不小心在本地push错远程仓库,直接推进去了。 从代码层面进行了回滚,所以重新提交下PR。