Nil is not an error, much less a serious one.
This commit is contained in:
parent
159f6b6b5f
commit
00ea284cbc
@ -55,6 +55,9 @@ func Warningf(f string, args ...any) *Warning {
|
|||||||
// IsSeriousError returns whether e is a non-warning error. If e is nil, this
|
// IsSeriousError returns whether e is a non-warning error. If e is nil, this
|
||||||
// returns false.
|
// returns false.
|
||||||
func IsSeriousError(e error) bool {
|
func IsSeriousError(e error) bool {
|
||||||
|
if e == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return !errors.Is(e, AnyWarning)
|
return !errors.Is(e, AnyWarning)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user