Use errors.AsErr to extract and detect errors.Error (#1936)

Switches from using errors.Is() to errors.As() so the error context is passed correctly.
This commit is contained in:
kkHAIKE
2024-04-10 05:25:00 +08:00
committed by GitHub
parent a32e5f0a42
commit a5277a3e7a
+1 -1
View File
@@ -36,7 +36,7 @@ func (e *entry) WithFields(fields map[string]any) Entry {
func (e *entry) SystemErr(err error) {
var athensErr errors.Error
if !errors.IsErr(err, athensErr) {
if !errors.AsErr(err, &athensErr) {
e.Error(err)
return
}