- fix bug in IsErrMatch
This commit is contained in:
@@ -58,6 +58,7 @@ func IsErrMatch(err error, strCode string, strList []string) (isMatch bool) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
if codeErr, ok := err.(*ErrorWithCode); ok {
|
if codeErr, ok := err.(*ErrorWithCode); ok {
|
||||||
if strCode == "" || codeErr.Code() == strCode {
|
if strCode == "" || codeErr.Code() == strCode {
|
||||||
|
isMatch = len(strList) == 0
|
||||||
for _, v := range strList {
|
for _, v := range strList {
|
||||||
if strings.Index(codeErr.ErrMsg(), v) > 0 {
|
if strings.Index(codeErr.ErrMsg(), v) > 0 {
|
||||||
isMatch = true
|
isMatch = true
|
||||||
|
|||||||
Reference in New Issue
Block a user