Documentation
¶
Overview ¶
Package errors provides helper functions for handling errors with specific HTTP status codes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithStatus ¶
WithStatus creates a new error with a specific HTTP status code and a given error message. It maps the HTTP status code to a corresponding gRPC status code. If the HTTP status code is not recognized, it logs a warning and uses gRPC's Unknown code. It returns a gRPC error with the mapped gRPC status code and the original error message.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.