Documentation ¶
Index ¶
- type Error
- func Duplicate(message string, err error) *Error
- func Internal(message string, err error) *Error
- func InvalidData(message string, err error) *Error
- func InvalidInput(message string, err error) *Error
- func New(message string, err error, httpCode int, grpcCode codes.Code) *Error
- func NotFound(message string, err error) *Error
- func OutOfRange(message string, err error) *Error
- func Unauthenticated(message string, err error) *Error
- func Unauthorized(message string, err error) *Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is an error with a human-readable message, wrapped error, and transport codes.
func Duplicate ¶
Duplicate returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 409 Conflict. For gRPC, the status code is 6 AlreadyExists.
func Internal ¶
Internal returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 500 InternalServerError. For gRPC, the status code is 13 Internal.
func InvalidData ¶
InvalidData returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 422 UnprocessableEntity. For gRPC, the status code is 3 InvalidArgument.
func InvalidInput ¶
InvalidInput returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 400 Bad Request. For gRPC, the status code is 3 InvalidArgument.
func New ¶
New returns a new error with the specified human-readable message, HTTP status code, and gRPC error code.
func NotFound ¶
NotFound returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 404 NotFound. For gRPC, the status code is 5 NotFound.
func OutOfRange ¶
OutOfRange returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 404 NotFound. For gRPC, the status code is 11 OutOfRange.
func Unauthenticated ¶
Unauthenticated returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 401 Unauthorized. For gRPC, the status code is 16 Unauthenticated.
func Unauthorized ¶
Unauthorized returns an error with a human-readable message and the corresponding transport codes. For HTTP, the status code is 403 Forbidden. For gRPC, the status code is 7 PermissionDenied.