Documentation ¶
Index ¶
- func Contains(err, target error) bool
- func Is(err, target error) bool
- func IsErrorDetail(err error) bool
- func IsNot(err, target error) bool
- func New(message ...any) error
- func NewSkipCaller(skipCaller int, message ...any) error
- func NotContains(err, target error) bool
- type ErrorDetail
- func (e *ErrorDetail) Error() string
- func (e *ErrorDetail) GetCause() string
- func (e *ErrorDetail) GetDebugStack() string
- func (e *ErrorDetail) GetFile() string
- func (e *ErrorDetail) GetFuncName() string
- func (e *ErrorDetail) GetLine() int
- func (e *ErrorDetail) GetMessage() string
- func (e *ErrorDetail) PrintCause()
- func (e *ErrorDetail) PrintStackTrace()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrorDetail ¶
IsErrorDetail check if the error is an ErrorDetail containing the pattern with file name, line, function name, message and debugStack
func New ¶
New error with space separated message values, if the message parameter is empty we return a nil value, otherwise returns normal value
func NewSkipCaller ¶
NewSkipCaller error with message values separate per space and skipCaller, if the message parameter is empty we return a nil value, otherwise returns normal value
func NotContains ¶ added in v1.1.3
NotContains validate message target not contains on message err
Types ¶
type ErrorDetail ¶ added in v1.0.9
type ErrorDetail struct {
// contains filtered or unexported fields
}
func Details ¶ added in v1.1.0
func Details(err error) *ErrorDetail
Details we obtain the values of an error passed in the parameter, and transform them into an ErrorDetail object, if the passed parameter is null, the return will also be null and if it is not in the desired errorDetail pattern, we return a new ErrDetail with the message being the err passed in the parameter.
func (*ErrorDetail) Error ¶ added in v1.0.9
func (e *ErrorDetail) Error() string
Error print the error as a string, genetic implementation of error in go
func (*ErrorDetail) GetCause ¶ added in v1.1.0
func (e *ErrorDetail) GetCause() string
GetCause returns formatted error cause
func (*ErrorDetail) GetDebugStack ¶ added in v1.0.9
func (e *ErrorDetail) GetDebugStack() string
GetDebugStack returns the value of the error debugStack field
func (*ErrorDetail) GetFile ¶ added in v1.0.9
func (e *ErrorDetail) GetFile() string
GetFile returns the value of the error file field
func (*ErrorDetail) GetFuncName ¶ added in v1.0.9
func (e *ErrorDetail) GetFuncName() string
GetFuncName returns the value of the error funcName field
func (*ErrorDetail) GetLine ¶ added in v1.0.9
func (e *ErrorDetail) GetLine() int
GetLine returns the value of the error line field
func (*ErrorDetail) GetMessage ¶ added in v1.0.9
func (e *ErrorDetail) GetMessage() string
GetMessage returns the value of the error message field
func (*ErrorDetail) PrintCause ¶ added in v1.1.0
func (e *ErrorDetail) PrintCause()
PrintCause print red message with cause error
func (*ErrorDetail) PrintStackTrace ¶ added in v1.1.0
func (e *ErrorDetail) PrintStackTrace()
PrintStackTrace print red message with detail error and debug stack