errors

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package errors contains logic for making errors user-friendly at the API boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStatusCode

func GetStatusCode(err error) codes.Code

func NewInvalidArgumentError

func NewInvalidArgumentError(msg string) error

NewInvalidArgumentError returns an invalid argument error.

This will be mapped to a 400 error in the API.

func NewNotFoundError

func NewNotFoundError(msg string) error

NewNotFoundError returns a not found error.

This will be mapped to a 404 error in the API.

func ServeMuxOption

func ServeMuxOption(logger *slog.Logger) runtime.ServeMuxOption

ServeMuxOption returns a `runtime.ServeMuxOption` that makes errors user-friendly at the API boundary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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