From 7ef781d84c443da20b25334a1cf3fd2aa1c5f96f Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Sun, 16 Aug 2020 13:40:26 +0200 Subject: [PATCH] Add isGeneric check for action errors --- compose/service/access_control_actions.gen.go | 12 ++++++++++-- compose/service/attachment_actions.gen.go | 12 ++++++++++-- compose/service/chart_actions.gen.go | 12 ++++++++++-- compose/service/module_actions.gen.go | 12 ++++++++++-- compose/service/namespace_actions.gen.go | 12 ++++++++++-- compose/service/notifications_actions.gen.go | 12 ++++++++++-- compose/service/page_actions.gen.go | 12 ++++++++++-- compose/service/record_actions.gen.go | 12 ++++++++++-- messaging/service/access_control_actions.gen.go | 12 ++++++++++-- messaging/service/attachment_actions.gen.go | 12 ++++++++++-- messaging/service/channel_actions.gen.go | 12 ++++++++++-- pkg/codegen/assets/actions.gen.go.tpl | 12 ++++++++++-- system/service/access_control_actions.gen.go | 12 ++++++++++-- system/service/application_actions.gen.go | 12 ++++++++++-- system/service/attachment_actions.gen.go | 12 ++++++++++-- system/service/auth_actions.gen.go | 12 ++++++++++-- system/service/reminder_actions.gen.go | 12 ++++++++++-- system/service/role_actions.gen.go | 12 ++++++++++-- system/service/sink_actions.gen.go | 12 ++++++++++-- system/service/statistics_actions.gen.go | 12 ++++++++++-- system/service/user_actions.gen.go | 12 ++++++++++-- 21 files changed, 210 insertions(+), 42 deletions(-) diff --git a/compose/service/access_control_actions.gen.go b/compose/service/access_control_actions.gen.go index 5aa3c6f80..f56a439df 100644 --- a/compose/service/access_control_actions.gen.go +++ b/compose/service/access_control_actions.gen.go @@ -218,8 +218,8 @@ func (e *accessControlError) Error() string { // // This function is auto-generated. // -func (e *accessControlError) Is(Resource error) bool { - t, ok := Resource.(*accessControlError) +func (e *accessControlError) Is(err error) bool { + t, ok := err.(*accessControlError) if !ok { return false } @@ -227,6 +227,14 @@ func (e *accessControlError) 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 *accessControlError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps accessControlError around another error // // This function is auto-generated. diff --git a/compose/service/attachment_actions.gen.go b/compose/service/attachment_actions.gen.go index 12338051f..2e9e839eb 100644 --- a/compose/service/attachment_actions.gen.go +++ b/compose/service/attachment_actions.gen.go @@ -451,8 +451,8 @@ func (e *attachmentError) Error() string { // // This function is auto-generated. // -func (e *attachmentError) Is(Resource error) bool { - t, ok := Resource.(*attachmentError) +func (e *attachmentError) Is(err error) bool { + t, ok := err.(*attachmentError) if !ok { return false } @@ -460,6 +460,14 @@ func (e *attachmentError) 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 *attachmentError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps attachmentError around another error // // This function is auto-generated. diff --git a/compose/service/chart_actions.gen.go b/compose/service/chart_actions.gen.go index 63fdaa7e9..a1367af8f 100644 --- a/compose/service/chart_actions.gen.go +++ b/compose/service/chart_actions.gen.go @@ -338,8 +338,8 @@ func (e *chartError) Error() string { // // This function is auto-generated. // -func (e *chartError) Is(Resource error) bool { - t, ok := Resource.(*chartError) +func (e *chartError) Is(err error) bool { + t, ok := err.(*chartError) if !ok { return false } @@ -347,6 +347,14 @@ func (e *chartError) 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 *chartError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps chartError around another error // // This function is auto-generated. diff --git a/compose/service/module_actions.gen.go b/compose/service/module_actions.gen.go index f902c06aa..ba8caa23a 100644 --- a/compose/service/module_actions.gen.go +++ b/compose/service/module_actions.gen.go @@ -347,8 +347,8 @@ func (e *moduleError) Error() string { // // This function is auto-generated. // -func (e *moduleError) Is(Resource error) bool { - t, ok := Resource.(*moduleError) +func (e *moduleError) Is(err error) bool { + t, ok := err.(*moduleError) if !ok { return false } @@ -356,6 +356,14 @@ func (e *moduleError) 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 *moduleError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps moduleError around another error // // This function is auto-generated. diff --git a/compose/service/namespace_actions.gen.go b/compose/service/namespace_actions.gen.go index a92dda713..f3d129f15 100644 --- a/compose/service/namespace_actions.gen.go +++ b/compose/service/namespace_actions.gen.go @@ -302,8 +302,8 @@ func (e *namespaceError) Error() string { // // This function is auto-generated. // -func (e *namespaceError) Is(Resource error) bool { - t, ok := Resource.(*namespaceError) +func (e *namespaceError) Is(err error) bool { + t, ok := err.(*namespaceError) if !ok { return false } @@ -311,6 +311,14 @@ func (e *namespaceError) 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 *namespaceError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps namespaceError around another error // // This function is auto-generated. diff --git a/compose/service/notifications_actions.gen.go b/compose/service/notifications_actions.gen.go index 4da3dba75..f0f37f57f 100644 --- a/compose/service/notifications_actions.gen.go +++ b/compose/service/notifications_actions.gen.go @@ -283,8 +283,8 @@ func (e *notificationError) Error() string { // // This function is auto-generated. // -func (e *notificationError) Is(Resource error) bool { - t, ok := Resource.(*notificationError) +func (e *notificationError) Is(err error) bool { + t, ok := err.(*notificationError) if !ok { return false } @@ -292,6 +292,14 @@ func (e *notificationError) 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 *notificationError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps notificationError around another error // // This function is auto-generated. diff --git a/compose/service/page_actions.gen.go b/compose/service/page_actions.gen.go index e7211c912..dcf9d25f6 100644 --- a/compose/service/page_actions.gen.go +++ b/compose/service/page_actions.gen.go @@ -359,8 +359,8 @@ func (e *pageError) Error() string { // // This function is auto-generated. // -func (e *pageError) Is(Resource error) bool { - t, ok := Resource.(*pageError) +func (e *pageError) Is(err error) bool { + t, ok := err.(*pageError) if !ok { return false } @@ -368,6 +368,14 @@ func (e *pageError) 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 *pageError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps pageError around another error // // This function is auto-generated. diff --git a/compose/service/record_actions.gen.go b/compose/service/record_actions.gen.go index 2aa5373d1..8307dadf5 100644 --- a/compose/service/record_actions.gen.go +++ b/compose/service/record_actions.gen.go @@ -443,8 +443,8 @@ func (e *recordError) Error() string { // // This function is auto-generated. // -func (e *recordError) Is(Resource error) bool { - t, ok := Resource.(*recordError) +func (e *recordError) Is(err error) bool { + t, ok := err.(*recordError) if !ok { return false } @@ -452,6 +452,14 @@ func (e *recordError) 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 *recordError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps recordError around another error // // This function is auto-generated. diff --git a/messaging/service/access_control_actions.gen.go b/messaging/service/access_control_actions.gen.go index af5f7cd61..0340457b3 100644 --- a/messaging/service/access_control_actions.gen.go +++ b/messaging/service/access_control_actions.gen.go @@ -218,8 +218,8 @@ func (e *accessControlError) Error() string { // // This function is auto-generated. // -func (e *accessControlError) Is(Resource error) bool { - t, ok := Resource.(*accessControlError) +func (e *accessControlError) Is(err error) bool { + t, ok := err.(*accessControlError) if !ok { return false } @@ -227,6 +227,14 @@ func (e *accessControlError) 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 *accessControlError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps accessControlError around another error // // This function is auto-generated. diff --git a/messaging/service/attachment_actions.gen.go b/messaging/service/attachment_actions.gen.go index 50bfcac19..25a1ed805 100644 --- a/messaging/service/attachment_actions.gen.go +++ b/messaging/service/attachment_actions.gen.go @@ -344,8 +344,8 @@ func (e *attachmentError) Error() string { // // This function is auto-generated. // -func (e *attachmentError) Is(Resource error) bool { - t, ok := Resource.(*attachmentError) +func (e *attachmentError) Is(err error) bool { + t, ok := err.(*attachmentError) if !ok { return false } @@ -353,6 +353,14 @@ func (e *attachmentError) 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 *attachmentError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps attachmentError around another error // // This function is auto-generated. diff --git a/messaging/service/channel_actions.gen.go b/messaging/service/channel_actions.gen.go index dab2ca87a..ce655740a 100644 --- a/messaging/service/channel_actions.gen.go +++ b/messaging/service/channel_actions.gen.go @@ -324,8 +324,8 @@ func (e *channelError) Error() string { // // This function is auto-generated. // -func (e *channelError) Is(Resource error) bool { - t, ok := Resource.(*channelError) +func (e *channelError) Is(err error) bool { + t, ok := err.(*channelError) if !ok { return false } @@ -333,6 +333,14 @@ func (e *channelError) 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 *channelError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps channelError around another error // // This function is auto-generated. diff --git a/pkg/codegen/assets/actions.gen.go.tpl b/pkg/codegen/assets/actions.gen.go.tpl index a5e6f7a0c..0e1b0a8b6 100644 --- a/pkg/codegen/assets/actions.gen.go.tpl +++ b/pkg/codegen/assets/actions.gen.go.tpl @@ -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. diff --git a/system/service/access_control_actions.gen.go b/system/service/access_control_actions.gen.go index 435336503..973dff625 100644 --- a/system/service/access_control_actions.gen.go +++ b/system/service/access_control_actions.gen.go @@ -218,8 +218,8 @@ func (e *accessControlError) Error() string { // // This function is auto-generated. // -func (e *accessControlError) Is(Resource error) bool { - t, ok := Resource.(*accessControlError) +func (e *accessControlError) Is(err error) bool { + t, ok := err.(*accessControlError) if !ok { return false } @@ -227,6 +227,14 @@ func (e *accessControlError) 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 *accessControlError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps accessControlError around another error // // This function is auto-generated. diff --git a/system/service/application_actions.gen.go b/system/service/application_actions.gen.go index 353b06171..14d1387ad 100644 --- a/system/service/application_actions.gen.go +++ b/system/service/application_actions.gen.go @@ -308,8 +308,8 @@ func (e *applicationError) Error() string { // // This function is auto-generated. // -func (e *applicationError) Is(Resource error) bool { - t, ok := Resource.(*applicationError) +func (e *applicationError) Is(err error) bool { + t, ok := err.(*applicationError) if !ok { return false } @@ -317,6 +317,14 @@ func (e *applicationError) 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 *applicationError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps applicationError around another error // // This function is auto-generated. diff --git a/system/service/attachment_actions.gen.go b/system/service/attachment_actions.gen.go index 5601a7604..cf48ee807 100644 --- a/system/service/attachment_actions.gen.go +++ b/system/service/attachment_actions.gen.go @@ -316,8 +316,8 @@ func (e *attachmentError) Error() string { // // This function is auto-generated. // -func (e *attachmentError) Is(Resource error) bool { - t, ok := Resource.(*attachmentError) +func (e *attachmentError) Is(err error) bool { + t, ok := err.(*attachmentError) if !ok { return false } @@ -325,6 +325,14 @@ func (e *attachmentError) 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 *attachmentError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps attachmentError around another error // // This function is auto-generated. diff --git a/system/service/auth_actions.gen.go b/system/service/auth_actions.gen.go index 97d37a28e..a9ef43e2f 100644 --- a/system/service/auth_actions.gen.go +++ b/system/service/auth_actions.gen.go @@ -318,8 +318,8 @@ func (e *authError) Error() string { // // This function is auto-generated. // -func (e *authError) Is(Resource error) bool { - t, ok := Resource.(*authError) +func (e *authError) Is(err error) bool { + t, ok := err.(*authError) if !ok { return false } @@ -327,6 +327,14 @@ func (e *authError) 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 *authError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps authError around another error // // This function is auto-generated. diff --git a/system/service/reminder_actions.gen.go b/system/service/reminder_actions.gen.go index 4668481e6..a4d16f2ef 100644 --- a/system/service/reminder_actions.gen.go +++ b/system/service/reminder_actions.gen.go @@ -347,8 +347,8 @@ func (e *reminderError) Error() string { // // This function is auto-generated. // -func (e *reminderError) Is(Resource error) bool { - t, ok := Resource.(*reminderError) +func (e *reminderError) Is(err error) bool { + t, ok := err.(*reminderError) if !ok { return false } @@ -356,6 +356,14 @@ func (e *reminderError) 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 *reminderError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps reminderError around another error // // This function is auto-generated. diff --git a/system/service/role_actions.gen.go b/system/service/role_actions.gen.go index 05255e2e5..04624e152 100644 --- a/system/service/role_actions.gen.go +++ b/system/service/role_actions.gen.go @@ -431,8 +431,8 @@ func (e *roleError) Error() string { // // This function is auto-generated. // -func (e *roleError) Is(Resource error) bool { - t, ok := Resource.(*roleError) +func (e *roleError) Is(err error) bool { + t, ok := err.(*roleError) if !ok { return false } @@ -440,6 +440,14 @@ func (e *roleError) 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 *roleError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps roleError around another error // // This function is auto-generated. diff --git a/system/service/sink_actions.gen.go b/system/service/sink_actions.gen.go index 2440edb8f..36876eb00 100644 --- a/system/service/sink_actions.gen.go +++ b/system/service/sink_actions.gen.go @@ -283,8 +283,8 @@ func (e *sinkError) Error() string { // // This function is auto-generated. // -func (e *sinkError) Is(Resource error) bool { - t, ok := Resource.(*sinkError) +func (e *sinkError) Is(err error) bool { + t, ok := err.(*sinkError) if !ok { return false } @@ -292,6 +292,14 @@ func (e *sinkError) 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 *sinkError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps sinkError around another error // // This function is auto-generated. diff --git a/system/service/statistics_actions.gen.go b/system/service/statistics_actions.gen.go index 26f636bd9..30f1004a0 100644 --- a/system/service/statistics_actions.gen.go +++ b/system/service/statistics_actions.gen.go @@ -171,8 +171,8 @@ func (e *statisticsError) Error() string { // // This function is auto-generated. // -func (e *statisticsError) Is(Resource error) bool { - t, ok := Resource.(*statisticsError) +func (e *statisticsError) Is(err error) bool { + t, ok := err.(*statisticsError) if !ok { return false } @@ -180,6 +180,14 @@ func (e *statisticsError) 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 *statisticsError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps statisticsError around another error // // This function is auto-generated. diff --git a/system/service/user_actions.gen.go b/system/service/user_actions.gen.go index 5ed74818e..ab1f7b01a 100644 --- a/system/service/user_actions.gen.go +++ b/system/service/user_actions.gen.go @@ -389,8 +389,8 @@ func (e *userError) Error() string { // // This function is auto-generated. // -func (e *userError) Is(Resource error) bool { - t, ok := Resource.(*userError) +func (e *userError) Is(err error) bool { + t, ok := err.(*userError) if !ok { return false } @@ -398,6 +398,14 @@ func (e *userError) 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 *userError) IsGeneric() bool { + return e.error == "generic" +} + // Wrap wraps userError around another error // // This function is auto-generated.