Error code docs
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2019-12-07 21:23:00 +01:00
parent 5777756f0b
commit 2485a65aad
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,7 @@ This document describes the different errors Vikunja can return.
| 3004 | 403 | The user needs to have read permissions on that list to perform that action. |
| 3005 | 400 | The list title cannot be empty. |
| 3006 | 404 | The list share does not exist. |
| 3007 | 400 | A list with this identifier already exists. |
| 4001 | 400 | The list task text cannot be empty. |
| 4002 | 404 | The list task does not exist. |
| 4003 | 403 | All bulk editing tasks must belong to the same list. |

View File

@ -491,7 +491,11 @@ const ErrCodeListIdentifierIsNotUnique = 3007
// HTTPError holds the http error description
func (err ErrListIdentifierIsNotUnique) HTTPError() web.HTTPError {
return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeListIdentifierIsNotUnique, Message: "There already exists a list with this identifier."}
return web.HTTPError{
HTTPCode: http.StatusBadRequest,
Code: ErrCodeListIdentifierIsNotUnique,
Message: "A list with this identifier already exists.",
}
}
// ================