Documentation ¶
Index ¶
- func HasTag(err error, tag string) bool
- func IsError(err error) bool
- func Root(err error) string
- func RootContext(err error) string
- func RootContextErr(err error) error
- func RootErr(err error) error
- func Status(err error) string
- func Tags(err error) []string
- func Trace(err error) string
- func TraceContext(err error) string
- func TraceContextErr(err error) error
- func TraceErr(err error) error
- type Error
- func AddTag(err error, tag string) *Error
- func AsError(err error) *Error
- func ErrorAction(action logutils.MessageActionType, dataType logutils.MessageDataType, ...) *Error
- func ErrorData(status logutils.MessageDataStatus, dataType logutils.MessageDataType, ...) *Error
- func New(message string) *Error
- func Newf(message string, args ...interface{}) *Error
- func SetStatus(err error, status string) *Error
- func Wrap(message string, err error) *Error
- func WrapErrorAction(action logutils.MessageActionType, dataType logutils.MessageDataType, ...) *Error
- func WrapErrorData(status logutils.MessageDataStatus, dataType logutils.MessageDataType, ...) *Error
- func Wrapf(format string, err error, args ...interface{}) *Error
- func (e Error) AddTag(tag string) *Error
- func (e *Error) Error() string
- func (e *Error) HasTag(tag string) bool
- func (e *Error) Internal() error
- func (e *Error) Root() string
- func (e *Error) RootContext() string
- func (e *Error) RootContextErr() error
- func (e *Error) RootErr() error
- func (e Error) SetStatus(status string) *Error
- func (e *Error) Status() string
- func (e *Error) String() string
- func (e *Error) Tags() []string
- func (e *Error) Trace() string
- func (e *Error) TraceContext() string
- func (e *Error) TraceContextErr() error
- func (e *Error) TraceErr() error
- type ErrorContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RootContext ¶
RootContext returns the root context of an Error
If not an Error, returns err.Error()
func RootContextErr ¶
RootContextErr returns the root context of an Error as an error
If not an Error, returns err
func RootErr ¶
RootErr returns the root message of an Error as an error
If not an Error, returns err
func TraceContext ¶
TraceContext returns the trace context of an Error
If not an Error, returns err.Error()
func TraceContextErr ¶
TraceContextErr returns the trace context of an Error as an error
If not an Error, returns err
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents an error entity
func AddTag ¶
AddTag adds the provided tag to err and returns the result
If not an Error, returns a new Error with the tag
func AsError ¶
AsError returns the provided error interface as an Error
Returns nil if the provided error is not an Error
func ErrorAction ¶
func ErrorAction(action logutils.MessageActionType, dataType logutils.MessageDataType, args logutils.MessageArgs) *Error
ErrorAction generates an error for an action
action: The action that is occurring dataType: The data type that the action is occurring on args: Any args that should be included in the message (nil if none)
func ErrorData ¶
func ErrorData(status logutils.MessageDataStatus, dataType logutils.MessageDataType, args logutils.MessageArgs) *Error
ErrorData generates an error for a data element
status: The status of the data dataType: The data type that the error is occurring on args: Any args that should be included in the message (nil if none)
func SetStatus ¶
SetStatus sets the status and returns the result
If not an Error, returns a new Error with the status
func WrapErrorAction ¶
func WrapErrorAction(action logutils.MessageActionType, dataType logutils.MessageDataType, args logutils.MessageArgs, err error) *Error
WrapErrorAction wraps an error for an action
action: The action that is occurring dataType: The data type that the action is occurring on args: Any args that should be included in the message (nil if none) err: Error to wrap
func WrapErrorData ¶
func WrapErrorData(status logutils.MessageDataStatus, dataType logutils.MessageDataType, args logutils.MessageArgs, err error) *Error
WrapErrorData wraps an error for a data element
status: The status of the data dataType: The data type that the error is occurring on args: Any args that should be included in the message (nil if none) err: Error to wrap
func (*Error) RootContext ¶
RootContext returns the root context
func (*Error) RootContextErr ¶
RootContextErr returns the root context as an error
func (*Error) TraceContext ¶
TraceContext returns the trace context
func (*Error) TraceContextErr ¶
TraceContextErr returns the trace context as an error
type ErrorContext ¶
type ErrorContext struct {
// contains filtered or unexported fields
}
ErrorContext represents the context of an error message
func (ErrorContext) String ¶
func (e ErrorContext) String() string
String converts the ErrorContext to a string