Skip to content

Commit

Permalink
Unify error descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gustawlippa committed Sep 28, 2021
1 parent be3fecd commit c0e566f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
26 changes: 16 additions & 10 deletions doc/developers-guide/domain_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,11 @@ curl -v -X PUT "http://localhost:8088/api/domains/example.db" \

Result codes:

* 204 - inserted.
* 403 - DB service disabled, or an unknown host type.
* 409 - domain already exists with a different host type.
* 500 - other errors.
* 204 - Domain was successfully inserted.
* 400 - Bad request.
* 403 - DB service disabled, or the host type is unknown.
* 409 - Domain already exists with a different host type.
* 500 - Other errors.

Example of the result body with a failure reason:

Expand All @@ -154,9 +155,13 @@ curl -v -X DELETE "http://localhost:8088/api/domains/example.db" \

Result codes:

* 204 - the domain is removed or not found.
* 403 - the domain is static, the DB service is disabled, the host type is wrong (does not match the host type in the database), or the host type is unknown.
* 500 - other errors.
* 204 - The domain is removed or not found.
* 403 - One of:
* the domain is static.
* the DB service is disabled.
* the host type is wrong (does not match the host type in the database).
* the host type is unknown.
* 500 - Other errors.

### Enable/disable domain

Expand All @@ -172,9 +177,10 @@ curl -v -X PATCH "http://localhost:8088/api/domains/example.db" \

Result codes:

* 204 - updated.
* 403 - the domain is static, or the service is disabled.
* 404 - domain not found.
* 204 - Domain was successfully updated.
* 403 - Domain is static, or the service is disabled.
* 404 - Domain not found.
* 500 - Other errors.

## Command Line Interface

Expand Down
8 changes: 4 additions & 4 deletions doc/rest-api/Dynamic-domains_swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ paths:
204:
description: Domain was successfully inserted.
400:
description: Bad request
description: Bad request.
examples:
application/json: {"what": "body is empty"}
409:
description: Domain already exists with a different host type.
examples:
application/json: {"what": "duplicate"}
403:
description: DB service disabled or the host type is unknown.
description: DB service disabled, or the host type is unknown.
examples:
application/json: {"what": "domain is static"}
500:
Expand Down Expand Up @@ -79,7 +79,7 @@ paths:
type: boolean
responses:
204:
description: Domain was sucessfully updated.
description: Domain was successfully updated.
404:
description: Domain not found.
examples:
Expand Down Expand Up @@ -141,6 +141,6 @@ paths:
examples:
application/json: {"what": "unknown host type"}
500:
description: "Other errors"
description: "Other errors."
examples:
application/json: {"what": "database error"}

0 comments on commit c0e566f

Please sign in to comment.