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

Add support for reading debug information from the error details #383

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

josephschorr
Copy link
Member

Copy link
Contributor

@vroldanbet vroldanbet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me, but to make sure it does not regress again, let's add a test.

Comment on lines 228 to 234
if errInfo, ok := grpcErrorInfoFrom(err); ok {
if encodedDebugInfo, ok := errInfo.Metadata["debug_trace_proto_text"]; ok {
debugInfo = &v1.DebugInformation{}
err = prototext.Unmarshal([]byte(encodedDebugInfo), debugInfo)
if err != nil {
return err
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please add a test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main regression test is on the SpiceDB side but I'll see if I can add a test for parsing the proto here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@josephschorr josephschorr force-pushed the err-debug-info branch 2 times, most recently from 31d7df0 to 565d440 Compare June 14, 2024 18:42
@josephschorr josephschorr added this pull request to the merge queue Jun 14, 2024
Merged via the queue into authzed:main with commit 454a6ee Jun 14, 2024
11 checks passed
@josephschorr josephschorr deleted the err-debug-info branch June 14, 2024 20:49
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants