mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 12:20:27 +08:00
优化错误处理相关代码
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
package shared
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
@@ -50,7 +50,7 @@ func (this *URLPattern) Init() error {
|
||||
}
|
||||
reg, err := regexp.Compile(pattern)
|
||||
if err != nil {
|
||||
return errors.New("compile '" + pattern + "' failed: " + err.Error())
|
||||
return fmt.Errorf("compile '%s' failed: %w", pattern, err)
|
||||
}
|
||||
this.reg = reg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user