-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
Following implementation at flemosr/tonic-richer-error.
@@ -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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 totonic-types
.