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

[Feature] onError in Streaming Mode Does Not Support Returning Custom Exceptions #14415

Open
3 of 4 tasks
nikbobo opened this issue Jul 10, 2024 · 6 comments
Open
3 of 4 tasks
Assignees
Labels
component/sdk Related with apache/dubbo

Comments

@nikbobo
Copy link

nikbobo commented Jul 10, 2024

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Apache Dubbo Component

Java SDK (apache/dubbo)

Descriptions

It is expected that the onError method of StreamObserver can pass through custom exceptions to the Consumer. Currently, the onError method in ServerCallToObserverAdapter is as follows:

public void onError(Throwable throwable) {
    final TriRpcStatus status = TriRpcStatus.getStatus(throwable);
    onCompleted(status);
}

This ultimately returns a StatusRpcException.

Related issues

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@nikbobo nikbobo added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Jul 10, 2024
@AlbumenJ
Copy link
Member

@EarthChen PTAL

@EarthChen
Copy link
Member

Yeah, we haven't figured out how to support it yet

@elysium-w
Copy link

@nikbobo I have great interest about this issue, could you assign it to me?

@nikbobo
Copy link
Author

nikbobo commented Aug 5, 2024

@nikbobo I have great interest about this issue, could you assign it to me?

I cannot assign to anyone, please contact project admin.

@oxsean oxsean added component/sdk Related with apache/dubbo and removed type/need-triage Need maintainers to triage component/need-triage Need maintainers to triage labels Aug 5, 2024
@oxsean
Copy link
Collaborator

oxsean commented Aug 5, 2024

@elysium-w Sure, but please write a brief proposal before coding.

@oxsean
Copy link
Collaborator

oxsean commented Aug 5, 2024

I think this requirement is unreasonable. Dubbo's stream is align to gRPC. In gRPC, if StreamObserver.onError is called within a stream, the error information is written back to the client via trailers, and the Throwable is not passed. then the stream is closed. A point we can optimization is provide extension that allow users to write additional error information back to the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/sdk Related with apache/dubbo
Projects
Status: Todo
Development

No branches or pull requests

5 participants