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

chore: show backtrace whenever there is an error #231

Merged
merged 4 commits into from
Feb 21, 2024

Conversation

renancloudwalk
Copy link
Contributor

No description provided.

@renancloudwalk renancloudwalk requested a review from a team as a code owner February 19, 2024 23:07
@renancloudwalk renancloudwalk marked this pull request as draft February 20, 2024 10:38
@carneiro-cw
Copy link
Contributor

carneiro-cw commented Feb 20, 2024

Just to add some context:
This could be useful because later when an RpcError is converted to an ErrorObjectOwned we lose a lot of the information stored in the error, such as its trace. So in places where we use the ? operator to deal with results in rpc_server.rs (eg. here) we never log the trace.

One solution would be to match every result, and trace in the arm that matches errors. This obviously would make the code more verbose.

Maybe there is another place in the server pipeline further up where we can trace the RpcError before it gets converted to an ErrorObjectOwned. (A middleware maybe?)

Also an alternative to adding this line to From<anyhow::Error> for RpcError would be adding it to From<RpcError> for ErrorObjectOwned which might make more sense.

@renancloudwalk renancloudwalk marked this pull request as ready for review February 21, 2024 01:01
@renancloudwalk renancloudwalk merged commit 78c96de into main Feb 21, 2024
6 checks passed
@renancloudwalk renancloudwalk deleted the rpc-server-show-backtrace branch February 21, 2024 12:52
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.

3 participants