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

Throw a custom Exception in Remoting, inner exception will be the serialized exception from user service code. #37

Closed
amanbha opened this issue Aug 30, 2019 · 1 comment
Assignees

Comments

@amanbha
Copy link
Contributor

amanbha commented Aug 30, 2019

currently the code throws the exception directly on the client side which rewrites the call stack, the code should wrap the exception in another Exception.
Alternatively an Aggregate Exception can also be thrown with the actual exception as its inner exception. Since user code awaits on tasks, throwing AggregateExceptions will not be right thing to do as await should not throw AggregateException and instead unwrap.

@amanbha amanbha changed the title Throw a wrapped Exception in Remoting for exceptions coming form user code. Throw a custom Exception in Remoting with inner exception as coming from user service code. Sep 2, 2019
@amanbha
Copy link
Contributor Author

amanbha commented Sep 2, 2019

The issue in dotnet which can help with setting stack trace correctly is closed without fixing: https://github.com/dotnet/corefx/issues/9294

Its suggested in the thread to throw a another custome exception with original exception from server as the inner exception.

@amanbha amanbha changed the title Throw a custom Exception in Remoting with inner exception as coming from user service code. Throw a custom Exception in Remoting, inner exception will be the serialized exception from user service code. Sep 2, 2019
@amanbha amanbha closed this as completed Sep 2, 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