Documentation ¶
Index ¶
- func Is(err error, code ...ErrCode) bool
- func New(code ErrCode, text string, w ...External) error
- func Panic(err error)
- func Reuse(err error) error
- func SupText(err error, text string) errordeprecated
- func TryCatch(fn func() error) (err error)
- func Unwrap(err error, code ErrCode) (error, bool)
- func UnwrapErrors(err error) (errs []string)
- func UnwrapFirst(err error) (ferr error)
- func With(err error, text string, w ...External) error
- func Wrap(err error, code ErrCode, text string, w ...External) error
- type ErrCode
- type Error
- type External
- type TagKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Panic ¶
func Panic(err error)
Panic if error is not nil, usually used in conjunction with TryCatch
func UnwrapErrors ¶
UnwrapErrors Returns the current all error text
func UnwrapFirst ¶ added in v1.6.4
Types ¶
type ErrCode ¶
type ErrCode int32
ErrCode error code type
func UnwrapCode ¶
UnwrapCode Returns the current error code
func UnwrapCodes ¶
UnwrapCodes Returns the current all error code
func UnwrapFirstCode ¶ added in v1.6.4
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps err with code
type TagKind ¶ added in v1.4.6
type TagKind string
const ( // Empty error None TagKind = "" // Internal errors, This means that some invariants expected by the underlying system have been broken Internal TagKind = "INTERNAL" // The operation was cancelled, typically by the caller Cancelled TagKind = "CANCELLED" // The client specified an invalid argument InvalidInput TagKind = "INVALID_INPUT" // Some requested entity was not found NotFound TagKind = "NOT_FOUND" // The caller does not have permission to execute the specified operation PermissionDenied TagKind = "PERMISSION_DENIED" Unauthorized TagKind = "UNAUTHORIZED" )
Click to show internal directories.
Click to hide internal directories.