package
Version:
v0.2.4
Opens a new window with list of versions in this module.
Published: May 19, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
HTTPStatus maps a Code to its canonical HTTP status code.
IsCode reports whether err carries the given Code.
WithCode wraps err with a Code. Preserves errors.Is / errors.As chains.
Code is a machine-readable error category.
const (
CodeInvalidArgument Code = "invalid_argument"
CodeNotFound Code = "not_found"
CodeConflict Code = "conflict"
CodeUnauthorized Code = "unauthorized"
CodeForbidden Code = "forbidden"
CodeDeadline Code = "deadline"
CodeUnavailable Code = "unavailable"
CodeInternal Code = "internal"
)
CodeOf returns the Code attached to err. Unknown errors return CodeInternal.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.