-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motivation: If an error is thrown from a server RPC then the status sent to the client will always have the unknown error code unless an `RPCError` is thrown. Moreover, there are various extensions to gRPC which rely on additional information being stuffed into the metadata. This is difficult and a bit error prone for users to do directly. We should provide a mechanism whereby errors can be converted to an `RPCError` such that the appropriate code, message and metadata are sent to the client. Modifications: - Add the `RPCErrorConvertible` protocol. Conforming types provide appropriate properties to populate an `RPCError`. - Add handling for this in the server executor such that convertible errors are converted into an `RPCError`. Result: Easier for users to propagate an appropriate status
- Loading branch information
Showing
4 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters