Documentation ¶
Index ¶
- Constants
- func ExistInMapMessage(code CodeError) bool
- func GetDefaultGlue() string
- func GetDefaultPattern() string
- func GetDefaultPatternTrace() string
- func RegisterIdFctMessage(minCode CodeError, fct Message)
- func SetDefaultGlue(glue string)
- func SetDefaultPattern(pattern string)
- func SetDefaultPatternTrace(patternTrace string)
- func SetModeReturnError(mode ErrorMode)
- func SetTracePathFilter(path string)
- type CodeError
- func (c CodeError) Error(p Error) Error
- func (c CodeError) ErrorParent(p ...error) Error
- func (c CodeError) GetInt() int
- func (c CodeError) GetMessage() string
- func (c CodeError) GetString() string
- func (c CodeError) GetUint16() uint16
- func (c CodeError) IfError(e Error) Error
- func (c CodeError) Iferror(e error) Error
- type Error
- type ErrorMode
- type Message
Constants ¶
const ( MIN_PKG_Archive = 100 MIN_PKG_Artifact = 200 MIN_PKG_Certif = 300 MIN_PKG_Console = 400 MIN_PKG_Crypt = 500 MIN_PKG_Httpcli = 600 MIN_PKG_Httpserver = 700 MIN_PKG_IOUtils = 800 MIN_PKG_LDAP = 900 MIN_PKG_Network = 1000 MIN_PKG_OAuth = 1100 MIN_PKG_Aws = 1200 MIN_PKG_Router = 1300 MIN_PKG_Semaphore = 1400 MIN_PKG_SMTP = 1500 MIN_PKG_Static = 1600 // MIN_PKG_Status = 1700 // unused // MIN_PKG_Update = 1800 // unused MIN_PKG_Version = 1900 MIN_AVAILABLE = 2000 )
const UNK_MESSAGE = "unknown error"
Variables ¶
This section is empty.
Functions ¶
func ExistInMapMessage ¶
func GetDefaultGlue ¶
func GetDefaultGlue() string
GetDefaultGlue return the current glue used to joins errors with parents.
func GetDefaultPattern ¶
func GetDefaultPattern() string
GetDefaultPattern return the current pattern used for string of error with code. The pattern is fmt pattern with 2 inputs in order : code, message.
func GetDefaultPatternTrace ¶
func GetDefaultPatternTrace() string
GetDefaultPatternTrace return the current pattern used for string of error with code and trace. The pattern is fmt pattern with 3 inputs in order : code, message, trace.
func RegisterIdFctMessage ¶
func SetDefaultGlue ¶
func SetDefaultGlue(glue string)
SetTracePathFilter define the glue string to be used to join main error with parents'errors.
func SetDefaultPattern ¶
func SetDefaultPattern(pattern string)
GetDefaultPatternTrace define the pattern to be used for string of error with code. The pattern is fmt pattern with 2 inputs in order : code, message.
func SetDefaultPatternTrace ¶
func SetDefaultPatternTrace(patternTrace string)
SetDefaultPatternTrace define the pattern to be used for string of error with code and trace. The pattern is fmt pattern with 3 inputs in order : code, message, trace.
func SetModeReturnError ¶
func SetModeReturnError(mode ErrorMode)
func SetTracePathFilter ¶ added in v1.3.0
func SetTracePathFilter(path string)
SetTracePathFilter customize the filter apply to filepath on trace.
Types ¶
type CodeError ¶
type CodeError uint16
const UNK_ERROR CodeError = 0
func (CodeError) ErrorParent ¶
func (CodeError) GetMessage ¶
type Error ¶
type Error interface { IsCodeError(code CodeError) bool HasCodeError(code CodeError) bool IsError(e error) bool HasError(err error) bool HasParent() bool AddParent(parent ...error) SetParent(parent ...error) AddParentError(parent ...Error) SetParentError(parent ...Error) Code() string CodeFull(glue string) string CodeSlice() []string CodeError(pattern string) string CodeErrorFull(pattern, glue string) string CodeErrorSlice(pattern string) []string CodeErrorTrace(pattern string) string CodeErrorTraceFull(pattern, glue string) string CodeErrorTraceSlice(pattern string) []string Error() string StringError() string StringErrorFull(glue string) string StringErrorSlice() []string GetError() error GetErrorFull(glue string) error GetErrorSlice() []error GetIError() Error GetIErrorSlice() []Error GetTrace() string GetTraceSlice() []string }