Versions in this module Expand all Collapse all v0 v0.1.0 Feb 26, 2026 Changes in this version + func Status(code Code) int + func TraceID(ctx context.Context) string + func Write(ctx context.Context, w http.ResponseWriter, status int, err *Error) + func WriteError(ctx context.Context, w http.ResponseWriter, err *Error) + type Code string + const CodeAlreadyExists + const CodeConflict + const CodeDeadlineExceeded + const CodeFailedPrecondition + const CodeForbidden + const CodeInternal + const CodeInvalidArgument + const CodeNotFound + const CodeResourceExhausted + const CodeTooManyRequests + const CodeUnauthenticated + const CodeUnavailable + func (c Code) String() string + type Error struct + Code Code + Details map[string]any + Message string + TraceID string + func AlreadyExists(message string) *Error + func As(err error) (*Error, bool) + func Conflict(message string) *Error + func DeadlineExceeded(message string) *Error + func FailedPrecondition(message string) *Error + func Forbidden(message string) *Error + func Internal(message string) *Error + func InvalidArgument(message string) *Error + func New(code Code, message string, details map[string]any) *Error + func NotFound(message string) *Error + func ResourceExhausted(message string) *Error + func Unauthenticated(message string) *Error + func Unavailable(message string) *Error + func (e *Error) Error() string + func (e *Error) MarshalJSON() ([]byte, error) + func (e *Error) WithTrace(ctx context.Context) *Error