errors

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BusinessError

type BusinessError struct {
	Message   string `json:"message"`
	ErrorCode string `json:"error_code"`
}

func Business

func Business(message, code string) BusinessError

func (BusinessError) Error

func (e BusinessError) Error() string

Error string.

func (BusinessError) Msgf

func (e BusinessError) Msgf(params ...interface{}) BusinessError

type NotFoundError

type NotFoundError struct {
	BusinessError
}

func NotFound

func NotFound(resource, code string) NotFoundError

NotFound error.

type SystemError

type SystemError struct {
	BusinessError
	Reason error `json:"reason"`
}

func System

func System(reason error, message, code string) SystemError

func (SystemError) Error

func (e SystemError) Error() string

func (SystemError) WithErr

func (e SystemError) WithErr(err error) SystemError

type ValidationError

type ValidationError struct {
	BusinessError
	Details []error `json:"details,omitempty"`
}

func Validation

func Validation(message, code string, details ...error) ValidationError

Validation error build.

Jump to

Keyboard shortcuts

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