- fix bug in IsErrMatch

This commit is contained in:
gazebo
2019-07-12 09:30:58 +08:00
parent aa78c0d67f
commit e8909acd00

View File

@@ -58,6 +58,7 @@ func IsErrMatch(err error, strCode string, strList []string) (isMatch bool) {
if err != nil {
if codeErr, ok := err.(*ErrorWithCode); ok {
if strCode == "" || codeErr.Code() == strCode {
isMatch = len(strList) == 0
for _, v := range strList {
if strings.Index(codeErr.ErrMsg(), v) > 0 {
isMatch = true