apperror

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorPrintFormat   string = "(%v)%v" // (Code)Message
	ErrorPointer       string = " -> "
	ErrorHolderLeft    string = "[ "
	ErrorHolderRight   string = " ]"
	ErrorSeparator     string = " | "
	ErrorMessageIndent string = "  "
)

These are print formatting related constants

Variables

This section is empty.

Functions

func GetAccessForbiddenError

func GetAccessForbiddenError(innerErrors ...error) model.AppError

GetAccessForbiddenError creates an error related to AccessForbidden

func GetBadRequestError

func GetBadRequestError(innerErrors ...error) model.AppError

GetBadRequestError creates an error related to BadRequest

func GetCircuitBreakError

func GetCircuitBreakError(innerErrors ...error) model.AppError

GetCircuitBreakError creates an error related to CircuitBreak

func GetCustomError added in v1.2.7

func GetCustomError(errorCode enum.Code, messageFormat string, parameters ...interface{}) model.AppError

GetCustomError creates a customized error with given code and formatted message

func GetDataCorruptionError

func GetDataCorruptionError(innerErrors ...error) model.AppError

GetDataCorruptionError creates an error related to DataCorruption

func GetGeneralFailureError

func GetGeneralFailureError(innerErrors ...error) model.AppError

GetGeneralFailureError creates a generic error based on GeneralFailure

func GetInnermostErrors

func GetInnermostErrors(err error) []error

GetInnermostErrors finds the innermost error wrapped within the given error

func GetInvalidOperation

func GetInvalidOperation(innerErrors ...error) model.AppError

GetInvalidOperation creates an error related to InvalidOperation

func GetNotFoundError

func GetNotFoundError(innerErrors ...error) model.AppError

GetNotFoundError creates an error related to NotFound

func GetNotImplementedError

func GetNotImplementedError(innerErrors ...error) model.AppError

GetNotImplementedError creates an error related to NotImplemented

func GetOperationLockError

func GetOperationLockError(innerErrors ...error) model.AppError

GetOperationLockError creates an error related to OperationLock

func GetUnauthorized added in v1.2.5

func GetUnauthorized(innerErrors ...error) model.AppError

GetUnauthorized creates an error related to Unauthorized

func Initialize added in v1.2.7

func Initialize() error

Initialize checks and validates the customization of AppErrors from consumer code

func WrapError

func WrapError(innerErrors []error, errorCode enum.Code, messageFormat string, parameters ...interface{}) model.AppError

WrapError wraps an inner error with given message as a new error with given error code

func WrapSimpleError

func WrapSimpleError(innerErrors []error, messageFormat string, parameters ...interface{}) model.AppError

WrapSimpleError wraps an inner error with given message as a new general failure error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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