add punctuation and comments for errors

This commit is contained in:
viehlieb 2023-02-23 15:52:16 +01:00
parent 2219488e84
commit d664e29873
2 changed files with 5 additions and 3 deletions

View File

@ -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. |

View File

@ -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)
}