Documentation ¶
Overview ¶
Package e provides error types and handling. Patterns are inspired by the following article: https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrInvalid ¶
ErrInvalid wraps an error such that it will fulfill IsInvalid.
func ErrNotFound ¶
ErrNotFound wraps an error such that it will fulfill IsNotFound.
func GRPC ¶
GRPC annotates an error with the appropriate gRPC status code based on the error interfaces it fulfills.
func IsFull ¶
IsFull determines whether an error indicates something was full. It does this by walking down the stack of errors built by pkg/errors and returning true for the first error that implements the following interface:
type fuller interface { Full() }
func IsInvalid ¶
IsInvalid determines whether an error indicates an input was invalid. It does this by walking down the stack of errors built by pkg/errors and returning true for the first error that implements the following interface:
type invalider interface { Invalid() }
func IsNotFound ¶
IsNotFound determines whether an error indicates something was not found. It does this by walking down the stack of errors built by pkg/errors and returning true for the first error that implements the following interface:
type notfounder interface { NotFound() }
Types ¶
This section is empty.