diff options
| author | rr- | 2016-09-10 10:37:28 +0200 |
|---|---|---|
| committer | rr- | 2016-09-10 11:36:01 +0200 |
| commit | 16d04adde0de461cd992f63440a84c9ea66ee106 (patch) | |
| tree | 68a09a36be6fe703ac2de96bb96750a35e80c163 /API.md | |
| parent | 8674c8b50e9988162aeeb57df23ef334f2701e93 (diff) | |
server/errors: add and document error codes
Diffstat (limited to 'API.md')
| -rw-r--r-- | API.md | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -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 |