Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Is = errors.Is
Functions ¶
Types ¶
type ErrFormat ¶ added in v0.28.20240903115607
var ( // e.Error() + "\n" ErrSimplifyFunc ErrFormat = func(e error) string { return e.Error() + "\n" } // 如是action,则 string(err.action) + ":" + e.Error() + "\n" // // 否则e.Error() + "\n" ErrActionSimplifyFunc ErrFormat = func(e error) string { if err, ok := e.(Error); ok && string(err.action) != err.Reason { return string(err.action) + ":" + e.Error() + "\n" } else { return e.Error() + "\n" } } // "> " + e.Error() + " " ErrInLineFunc ErrFormat = func(e error) string { return "> " + e.Error() + " " } // 如是action,则 "> " + string(err.action) + ":" + e.Error() + " " // // 否则"> " + e.Error() + " " ErrActionInLineFunc ErrFormat = func(e error) string { if err, ok := e.(Error); ok && string(err.action) != err.Reason { return fmt.Sprintf("> %v:%v ", err.action, strings.TrimSpace(e.Error())) } else { return fmt.Sprintf("> %v ", strings.TrimSpace(e.Error())) } } )
type Error ¶
type Error struct {
Reason string
// contains filtered or unexported fields
}
func (Error) WithReason ¶ added in v0.28.20240325172911
Click to show internal directories.
Click to hide internal directories.