mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
implement Is for ErrList
This commit is contained in:
@@ -177,3 +177,18 @@ func (e ErrList) String() string {
|
||||
func (e ErrList) Error() string {
|
||||
return e.String()
|
||||
}
|
||||
|
||||
func (e ErrList) Is(target error) bool {
|
||||
for _, ee := range e.List {
|
||||
if ee.E == nil {
|
||||
continue
|
||||
}
|
||||
if ee.E == target {
|
||||
return true
|
||||
} else if errors.Is(ee.E, target) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user