errs

package
v0.0.0-...-3794c23 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func E

func E(args ...interface{}) error

func NewHTTPResponse

func NewHTTPResponse(c echo.Context, logger *zap.Logger, err error) error

func ParseGrpcError

func ParseGrpcError(err error) error

Types

type Code

type Code string

type Error

type Error struct {
	Kind Kind
	Code Code
	Err  error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type HTTPError

type HTTPError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Kind

type Kind uint8
const (
	Other         Kind = iota // Unclassified error. This value is not printed in the error message.
	Invalid                   // Invalid operation for this type of item.
	IO                        // External I/O error such as network failure.
	Exist                     // Item already exists.
	NotExist                  // Item does not exist.
	Private                   // Information withheld.
	Internal                  // Internal error or inconsistency.
	BrokenLink                // Link target does not exist.
	Database                  // Error from database.
	Validation                // Input validation error.
	Unanticipated             // Unanticipated error.
	Unknown
	InvalidRequest // Invalid Request
	Unauthenticated
	Unauthorized
	Integration
)

func (Kind) String

func (k Kind) String() string

Jump to

Keyboard shortcuts

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