Documentation
¶
Overview ¶
Package errors provides shared sentinel errors and gRPC mapping for paper-board services. All public service errors should wrap one of these sentinels so callers can use errors.Is for routing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrConflict = errors.New("conflict") ErrPermissionDenied = errors.New("permission denied") ErrInvalidInput = errors.New("invalid input") ErrRateLimited = errors.New("rate limited") ErrInternal = errors.New("internal error") )
Sentinel errors.
Functions ¶
func FromGRPCStatus ¶
FromGRPCStatus converts a gRPC status error back to a wrapped sentinel. Useful in client code to use errors.Is across the wire.
func ToGRPCStatus ¶
ToGRPCStatus maps a wrapped sentinel error to a gRPC status. Used by service handlers to convert internal errors into RPC responses.
if err := repo.Get(ctx, id); err != nil {
return nil, errors.ToGRPCStatus(err)
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.