package
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Jun 11, 2025
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
¶
Package httperr provides the ability to attach and extract the status code from HTTP errors.
ErrorCode returns the gRPC code associated with the given error
if it implements the httperr.Error interface.
ErrorCoder return the HTTP ErrorCoder.
New wraps the given error and adds an HTTP code.
ToGRPC returns the gRPC status code associated with the given HTTP status code.
type Error interface {
HTTPCode() int
error
}
An Error is an error with an explicit HTTP code.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.