Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 68d90a0496 |
9
error.go
9
error.go
@@ -61,3 +61,12 @@ func (e *Error) Translate(ctx context.Context) string {
|
|||||||
|
|
||||||
return printer.Sprintf(e.key, translatedParams...)
|
return printer.Sprintf(e.key, translatedParams...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *Error) Is(other error) bool {
|
||||||
|
switch err := other.(type) {
|
||||||
|
case *Error:
|
||||||
|
return e.key == err.key
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user