Skip to content
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

Merged
merged 9 commits into from Jul 12, 2020
Merged

Conversation

cvictory
Copy link
Contributor

@cvictory cvictory commented Jul 1, 2020

1.当java抛出自定义业务异常的时候,当dubb-go client没有注册这个异常类型,这时候会出现错误。
这里会将这种异常统一转换为BizException。

2.原来的stackTraceElement数据丢失,进行修复。

之前的pr : #204 ,不小心在本地push错远程仓库,直接推进去了。 从代码层面进行了回滚,所以重新提交下PR。

Copy link
Contributor

@wongoo wongoo left a 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

java_unknown_exception.go Show resolved Hide resolved
@wongoo
Copy link
Contributor

wongoo commented Jul 4, 2020

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

@cvictory
Copy link
Contributor Author

cvictory commented Jul 6, 2020

@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目录下的两个文件。

@@ -0,0 +1,5 @@
Cjava.lang.RuntimeException�detailMessagecause
stackTracesuppressedExceptions` test exceptQ�V[java.lang.StackTraceElement�?Cjava.lang.StackTraceElement�declaringClass
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why display not normal ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

存储在里面是以byte数组形式。

@wongoo
Copy link
Contributor

wongoo commented Jul 9, 2020

@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
Copy link
Member

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?

@AlexStocks AlexStocks merged commit 44192c6 into apache:master Jul 12, 2020
@cvictory cvictory mentioned this pull request Jul 14, 2020
zhangymPerson added a commit to zhangymPerson/dubbo-go-hessian2 that referenced this pull request Sep 12, 2020
AlexStocks added a commit that referenced this pull request Sep 22, 2020
zhaoyunxing92 pushed a commit that referenced this pull request Sep 4, 2021
Ftr: catch exceptions that user defined
zhaoyunxing92 pushed a commit that referenced this pull request Sep 4, 2021
add support java8 time object. #212, #221
zhaoyunxing92 pushed a commit that referenced this pull request Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants