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

java Exception class #53

Closed
fangyincheng opened this issue Jun 4, 2019 · 4 comments
Closed

java Exception class #53

fangyincheng opened this issue Jun 4, 2019 · 4 comments

Comments

@fangyincheng
Copy link
Contributor

What would you like to be added:

 Can it support Java exception classes?

Why is this needed:

When dubbo-go's returns an exception, java need decode as Throwable.

java code:

Object obj = in.readObject();
if (obj instanceof Throwable == false)
     throw new IOException("Response data error, expect Throwable, but get " + obj);
setException((Throwable) obj);
setAttachments((Map<String, String>) in.readObject(Map.class));
@wongoo
Copy link
Contributor

wongoo commented Jun 4, 2019

@fangyincheng I think it's supported. you can define a POJO with a field detailMessage and set the JavaClassName to java.lang.Throwable. Please have a try. Expecting your result!

@fangyincheng
Copy link
Contributor Author

fangyincheng commented Jun 4, 2019

@wongoo Exception is in java SDK, so I thinks it should not be feeled by user. Should it be supported in hessian?

@wongoo
Copy link
Contributor

wongoo commented Jun 4, 2019

@fangyincheng yes, I think so! can u submit a pr for it?

@fangyincheng
Copy link
Contributor Author

fangyincheng commented Jun 4, 2019

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

No branches or pull requests

2 participants