Documentation
¶
Index ¶
- Variables
- type Code
- type ECode
- func (err *ECode) Copy() Code
- func (err *ECode) Error() string
- func (err *ECode) GetDetails() []string
- func (err *ECode) Is(e error) bool
- func (err *ECode) UnWrapError() string
- func (err *ECode) Unwrap() error
- func (err *ECode) WithDetails(details ...string) Code
- func (err *ECode) Wrap(subErr error) Code
- func (err *ECode) WrapWithDetails(subErr error, details ...string) Code
Constants ¶
This section is empty.
Variables ¶
View Source
var AllCodes []Code //for print
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code interface {
Error() string
// GetDetails get error details,it may help developers
GetDetails() []string
// Unwrap unwrap the error
Unwrap() error
// UnWrapError unwrap the error to get the error messages
UnWrapError() string
//WithDetails make new code with details
WithDetails(details ...string) Code
//Wrap wrap sub error
Wrap(err error) Code
//WrapWithDetails wrap sub error and some details
WrapWithDetails(err error, details ...string) Code
//Copy make an error copy
Copy() Code
}
Source Files
¶
- codes.go
- ecode.go
Click to show internal directories.
Click to hide internal directories.