errors

package
v0.0.0-...-e5f8ed5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, writer http.ResponseWriter, request *http.Request, err error)

Handler is error handler that will mutate the http status code based on error's type

Types

type ConflictError

type ConflictError struct {
	// contains filtered or unexported fields
}

ConflictError error type for creating an existing entity

func NewConflictError

func NewConflictError(entity string, err error) *ConflictError

NewConflictError creates new ConflictError instance

func (*ConflictError) Error

func (e *ConflictError) Error() string

Error Return error message

func (*ConflictError) Is

func (e *ConflictError) Is(target error) bool

Is checks whether an error is due to ConflictError

type InvalidInputError

type InvalidInputError struct {
	// contains filtered or unexported fields
}

InvalidInputError error type for invalid users input

func NewInvalidInputErrorf

func NewInvalidInputErrorf(format string, a ...any) *InvalidInputError

NewInvalidInputErrorf creates new instance of InvalidInputError

func (*InvalidInputError) Error

func (e *InvalidInputError) Error() string

Error Return error message

func (*InvalidInputError) Is

func (e *InvalidInputError) Is(target error) bool

Is check whether the error is InvalidInputError

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError error type for missing entity

func NewNotFoundError

func NewNotFoundError(entity string, identity any) *NotFoundError

NewNotFoundError creates new instance of NotFoundError

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error Return error message

func (*NotFoundError) Is

func (e *NotFoundError) Is(target error) bool

Is check whether the error is NotFoundError

Jump to

Keyboard shortcuts

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