From d664e29873eafecc16024ff3fc6113d3b226eed6 Mon Sep 17 00:00:00 2001 From: viehlieb Date: Thu, 23 Feb 2023 15:52:16 +0100 Subject: [PATCH] add punctuation and comments for errors --- docs/content/doc/usage/errors.md | 6 +++--- pkg/models/error.go | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/content/doc/usage/errors.md b/docs/content/doc/usage/errors.md index 45f870b4c..9d850d931 100644 --- a/docs/content/doc/usage/errors.md +++ b/docs/content/doc/usage/errors.md @@ -114,9 +114,9 @@ This document describes the different errors Vikunja can return. | 6005 | 409 | The user is already a member of that team. | | 6006 | 400 | Cannot delete the last team member. | | 6007 | 403 | The team does not have access to the project to perform that action. | -| 6008 | 400 | There are no teams found with that team name | -| 6009 | 400 | There is no oidc team with that team name and oidcId | -| 6010 | 400 | There are no oidc teams found for the user | +| 6008 | 400 | There are no teams found with that team name. | +| 6009 | 400 | There is no oidc team with that team name and oidcId. | +| 6010 | 400 | There are no oidc teams found for the user. | diff --git a/pkg/models/error.go b/pkg/models/error.go index 1a6c9d7ab..12f1f5a23 100644 --- a/pkg/models/error.go +++ b/pkg/models/error.go @@ -1217,6 +1217,7 @@ func (err ErrTeamDoesNotHaveAccessToProject) HTTPError() web.HTTPError { return web.HTTPError{HTTPCode: http.StatusForbidden, Code: ErrCodeTeamDoesNotHaveAccessToProject, Message: "This team does not have access to the project."} } +// ErrTeamsDoNotExist represents an error where Teams searched via non-unique name do not exist. type ErrTeamsDoNotExist struct { Name string } @@ -1251,6 +1252,7 @@ func IsErrOIDCTeamDoesNotExist(err error) bool { 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) }