errors

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 5 Imported by: 0

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

func WithStatus(httpStatus int, err error) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL