errorgoogle

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errore

func Errore[E constraints.Integer](code E, err error) error

Errore converts the given error into a gRPC error with the given code if err's type is not *status.Status. ignore code if err is *status.Status.

func Errorf

func Errorf[E constraints.Integer](code E, format string, a ...any) error

func HTTPError

func HTTPError(ctx context.Context, mux *runtime.ServeMux,
	marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error)

HTTPError translate error into error schema for Google's JSON HTTP APIs. https://cloud.google.com/apis/design/errors

func NewErrorStatus

func NewErrorStatus(err error) *errors.Error_Status

Types

This section is empty.

Jump to

Keyboard shortcuts

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