sing/common/exceptions/cause.go
2022-07-06 21:15:32 +08:00

17 lines
262 B
Go

package exceptions
type causeError struct {
message string
cause error
}
func (e *causeError) Error() string {
if e.cause == nil {
return e.message
}
return e.message + ": " + e.cause.Error()
}
func (e *causeError) Unwrap() error {
return e.cause
}