From ab3926e307bed9d665010f6613409ed093e256fe Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Tue, 19 Sep 2023 12:33:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20super=20=E5=8C=85=E4=BC=98=E5=8C=96=20Ge?= =?UTF-8?q?tError=20=E5=87=BD=E6=95=B0=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/super/error.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/super/error.go b/utils/super/error.go index 6fdaaa6..4c01ff4 100644 --- a/utils/super/error.go +++ b/utils/super/error.go @@ -42,6 +42,9 @@ func RegErrorRef(code int, message string, ref error) error { // GetError 通过错误引用获取错误码和真实错误信息,如果错误不存在则返回 0,如果错误引用不存在则返回原本的错误 func GetError(err error) (int, error) { + if errorManagerInstance == nil { + return 0, err + } unw := errors.Unwrap(err) if unw == nil { unw = err