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

feat(types): Add gRPC Richer Error Model support (Help) #1293

Merged
merged 5 commits into from
Feb 23, 2023

Conversation

flemosr
Copy link
Contributor

@flemosr flemosr commented Feb 22, 2023

Motivation

The gRPC Richer Error Model is quite useful to send additional feedback to clients, and is supported by many gRPC libraries in other languages.

Solution

This PR continues the work initiated in #1068, building on the changes made in #1282. It adds support for the Help standard error message type to tonic-types.

@@ -103,7 +109,7 @@ impl ErrorDetails {
/// QuotaViolation::new("subject 2", "description 2"),
/// ]);
/// ```
pub fn with_quota_failure(violations: Vec<QuotaViolation>) -> Self {
pub fn with_quota_failure(violations: impl Into<Vec<QuotaViolation>>) -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

FYI these are breaking changes but should be fine since I merge this PR I will release a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we take this opportunity to remove the cloning operations from the ErrorDetails getters (like ErrorDetails::bad_request)? I could do this pushing a commit to #1295, or include this change in the next PR.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, if its a breaking change lets get it in, id like to make a breaking change release for tonic soon.

@LucioFranco LucioFranco added this pull request to the merge queue Feb 23, 2023
Merged via the queue into hyperium:master with commit d6041a9 Feb 23, 2023
@flemosr flemosr deleted the richer-error-split-9 branch February 24, 2023 13:08
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.

2 participants