Documentation
¶
Index ¶
- func Errorf(msg string, args ...interface{}) error
- func GetStackTrace(err error) string
- func GetUserMessage(err error) string
- func UserErrorf(msg string, args ...interface{}) error
- func UserWrapf(err error, msg string, args ...interface{}) error
- func Wrapf(err error, msg string, args ...interface{}) error
- type ErrorType
- func (errorType ErrorType) Errorf(msg string, args ...interface{}) error
- func (errorType ErrorType) Set(err error) error
- func (errorType ErrorType) UserErrorf(msg string, args ...interface{}) error
- func (errorType ErrorType) UserWrapf(err error, msg string, args ...interface{}) error
- func (errorType ErrorType) Wrapf(err error, msg string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStackTrace ¶
GetStackTrace returns the stack trace starting from the first error that has been wrapped / created
func GetUserMessage ¶
GetUserMessage returns user readable error message for all errors If error is not `userMessager` returns empty string
func UserErrorf ¶
UserErrorf returns an error with format string
Types ¶
type ErrorType ¶
type ErrorType uint
ErrorType is the type of an error
const ( // NoType error - HTTP internal Error - code 500 NoType ErrorType = http.StatusInternalServerError // BadRequest error - Code 400 BadRequest ErrorType = http.StatusBadRequest // NotFound error - Code 404 NotFound ErrorType = http.StatusNotFound Unauthorized ErrorType = http.StatusUnauthorized // Conflict - Code 409 Conflict ErrorType = http.StatusConflict )
func GetType ¶
GetType returns the error type for all errors if error is not `typed` - it returns NoType
func (ErrorType) UserErrorf ¶
UserErrorf creates a new error with a user message
Click to show internal directories.
Click to hide internal directories.