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

Translate unknown exceptions to UNKNOWN Status #461

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nehme-bilal-ah
Copy link

@nehme-bilal-ah nehme-bilal-ah commented Nov 18, 2023

When using fromThrowable for unknown exceptions, we are recursively looking for a StatusException or StatusRuntimeException and returning the status of an inner exception. This isn't really the correct behavior because an inner exception that is not caught by the application and not explicitly converted to a StatusException doesn't necessarily translate to the Status that should be returned by the application. More importantly, returning the inner status exception with it's parent as a cause inverts the stacktrace (it looks as if the parent exception is the cause of the status exception but it's the opposite), which leads to confusing stacktraces.

In fact, there is still a problem with the stacktrace if ServiceA is calling ServiceB which throws a status exception that is not caught by ServiceA. The stacktrace would only show the code path in ServiceB and the stacktrace in ServiceA would be lost.. there is more that needs to be done to fix this issue..

Copy link

linux-foundation-easycla bot commented Nov 18, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: nehme-bilal-ah / name: Nehme (2955cb7)

@nehme-bilal-ah
Copy link
Author

@lowasser are you able to take a look at this PR?

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

1 participant