aboutsummaryrefslogtreecommitdiff
path: root/API.md
diff options
context:
space:
mode:
authorrr-2016-09-10 10:37:28 +0200
committerrr-2016-09-10 11:36:01 +0200
commit16d04adde0de461cd992f63440a84c9ea66ee106 (patch)
tree68a09a36be6fe703ac2de96bb96750a35e80c163 /API.md
parent8674c8b50e9988162aeeb57df23ef334f2701e93 (diff)
server/errors: add and document error codes
Diffstat (limited to 'API.md')
-rw-r--r--API.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/API.md b/API.md
index ec5e4e8..9b79598 100644
--- a/API.md
+++ b/API.md
@@ -120,11 +120,58 @@ code together with JSON of following structure:
```json5
{
+ "name": "Name of the error, e.g. 'PostNotFoundError'",
"title": "Generic title of error message, e.g. 'Not found'",
"description": "Detailed description of what went wrong, e.g. 'User `rr-` not found."
}
```
+List of possible error names:
+
+- `MissingRequiredFileError`
+- `MissingRequiredParameterError`
+- `InvalidParameterError` (when trying to pass text when integer is expected etc.)
+- `IntegrityError` (race conditions when editing the same resource)
+- `SearchError`
+- `AuthError`
+- `PostNotFoundError`
+- `PostAlreadyFeaturedError`
+- `PostAlreadyUploadedError`
+- `InvalidPostIdError`
+- `InvalidPostSafetyError`
+- `InvalidPostSourceError`
+- `InvalidPostContentError`
+- `InvalidPostRelationError`
+- `InvalidPostNoteError`
+- `InvalidPostFlagError`
+- `InvalidFavoriteTargetError`
+- `InvalidCommentIdError`
+- `CommentNotFoundError`
+- `EmptyCommentTextError`
+- `InvalidScoreTargetError`
+- `InvalidScoreValueError`
+- `TagCategoryNotFoundError`
+- `TagCategoryAlreadyExistsError`
+- `TagCategoryIsInUseError`
+- `InvalidTagCategoryNameError`
+- `InvalidTagCategoryColorError`
+- `TagNotFoundError`
+- `TagAlreadyExistsError`
+- `TagIsInUseError`
+- `InvalidTagNameError`
+- `InvalidTagRelationError`
+- `InvalidTagCategoryError`
+- `InvalidTagDescriptionError`
+- `UserNotFoundError`
+- `UserAlreadyExistsError`
+- `InvalidUserNameError`
+- `InvalidEmailError`
+- `InvalidPasswordError`
+- `InvalidRankError`
+- `InvalidAvatarError`
+- `ValidationError` (catch all for odd validation errors)
+
+
## Field selecting
For performance considerations, sometimes the client might want to choose the

© 2015 - 2026 Jakob L. Kreuze