From f4b9e5989abe1bb82214c077e1b180f8673f61fd Mon Sep 17 00:00:00 2001 From: viehlieb Date: Mon, 8 May 2023 16:54:00 +0200 Subject: [PATCH] fix rebase error --- pkg/models/error.go | 48 --------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/pkg/models/error.go b/pkg/models/error.go index e3bb5800f9..83f530a4a5 100644 --- a/pkg/models/error.go +++ b/pkg/models/error.go @@ -1196,54 +1196,6 @@ func (err ErrOIDCTeamsDoNotExistForUser) HTTPError() web.HTTPError { return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeTeamDoesNotExist, Message: "No Teams with property oidcId could be found for User."} } -// ErrOIDCTeamDoesNotExist represents an error where a team with specified name and specified oidcId property does not exist -type ErrOIDCTeamDoesNotExist struct { - OidcID string - Name string -} - -// IsErrOIDCTeamDoesNotExist checks if an error is ErrOIDCTeamDoesNotExist. -func IsErrOIDCTeamDoesNotExist(err error) bool { - _, ok := err.(ErrOIDCTeamDoesNotExist) - return ok -} - -// ErrTeamDoesNotExist represents an error where a team does not exist -func (err ErrOIDCTeamDoesNotExist) Error() string { - return fmt.Sprintf("No Team with that name and valid property oidcId could be found [Team Name: %v] [OidcId : %v] ", err.Name, err.OidcID) -} - -// ErrCodeTeamDoesNotExist holds the unique world-error code of this error -const ErrCodeOIDCTeamDoesNotExist = 6008 - -// HTTPError holds the http error description -func (err ErrOIDCTeamDoesNotExist) HTTPError() web.HTTPError { - return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeTeamDoesNotExist, Message: "No Team with that name and valid property oidcId could be found."} -} - -// ErrOIDCTeamsDoNotExistForUser represents an error where an oidcTeam does not exist for the user -type ErrOIDCTeamsDoNotExistForUser struct { - UserID int64 -} - -// IsErrOIDCTeamsDoNotExistForUser checks if an error is ErrOIDCTeamsDoNotExistForUser. -func IsErrOIDCTeamsDoNotExistForUser(err error) bool { - _, ok := err.(ErrOIDCTeamsDoNotExistForUser) - return ok -} - -func (err ErrOIDCTeamsDoNotExistForUser) Error() string { - return fmt.Sprintf("No Teams with property oidcId could be found for User [User ID: %d]", err.UserID) -} - -// ErrCodeTeamDoesNotExist holds the unique world-error code of this error -const ErrCodeOIDCTeamsDoNotExistForUser = 6009 - -// HTTPError holds the http error description -func (err ErrOIDCTeamsDoNotExistForUser) HTTPError() web.HTTPError { - return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeTeamDoesNotExist, Message: "No Teams with property oidcId could be found for User."} -} - // ==================== // User <-> Project errors // ====================