Documentation ¶
Index ¶
- func Code(err error) gcode.Code
- func New(text string) error
- func NewCode(code gcode.Code, text ...string) error
- func NewCodef(code gcode.Code, format string, args ...interface{}) error
- func Newf(format string, args ...interface{}) error
- func WrapCode(code gcode.Code, err error, text ...string) error
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Code ¶
Code returns the error code of current error. It returns CodeNil if it has no error code or it does not implements interface Code.
func NewCodef ¶
NewCodef returns an errors that has errors code and formats as the given format and args.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is custom errors for additional features.
func (*Error) Current ¶
Current creates and returns the current level errors. It returns nil if current level errors is nil.
func (*Error) Format ¶
Format formats the frame according to the fmt.Formatter interface.
%v, %s : Print all the errors string; %-v, %-s : Print current level errors string; %+s : Print full stack errors list; %+v : Print the errors string and full stack errors list;
func (*Error) MarshalJSON ¶
MarshalJSON implements the interface MarshalJSON for json.Marshal. Note that do not use pointer as its receiver here.