3
0

Add isGeneric check for action errors

This commit is contained in:
Denis Arh
2020-08-16 13:40:26 +02:00
parent 41d419ae64
commit 7ef781d84c
21 changed files with 210 additions and 42 deletions
+10 -2
View File
@@ -255,8 +255,8 @@ func (e *{{ $.Service }}Error) Error() string {
//
// This function is auto-generated.
//
func (e *{{ $.Service }}Error) Is(Resource error) bool {
t, ok := Resource.(*{{ $.Service }}Error)
func (e *{{ $.Service }}Error) Is(err error) bool {
t, ok := err.(*{{ $.Service }}Error)
if !ok {
return false
}
@@ -264,6 +264,14 @@ func (e *{{ $.Service }}Error) Is(Resource error) bool {
return t.resource == e.resource && t.error == e.error
}
// Is fn for error equality check
//
// This function is auto-generated.
//
func (e *{{ $.Service }}Error) IsGeneric() bool {
return e.error == "generic"
}
// Wrap wraps {{ $.Service }}Error around another error
//
// This function is auto-generated.