Skip to content

Commit

Permalink
feat: add new standard errors (#1890)
Browse files Browse the repository at this point in the history
* feat: add new standard errors for 404 and 409

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
  • Loading branch information
gastonfournier and thomasheartman committed Aug 5, 2022
1 parent 2f011f3 commit 678e3f9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib/openapi/util/standard-responses.ts
Expand Up @@ -11,9 +11,20 @@ const badRequestResponse = {
description: 'The request data does not match what we expect.',
} as const;

const notFoundResponse = {
description: 'The requested resource was not found.',
} as const;

const conflictResponse = {
description:
'The provided resource can not be created or updated because it would conflict with the current state of the resource or with an already existing resource, respectively.',
} as const;

const standardResponses = {
400: badRequestResponse,
401: unauthorizedResponse,
404: notFoundResponse,
409: conflictResponse,
} as const;

type StandardResponses = typeof standardResponses;
Expand Down

0 comments on commit 678e3f9

Please sign in to comment.