1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat: add new standard errors (#1890)

* feat: add new standard errors for 404 and 409

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
This commit is contained in:
Gastón Fournier 2022-08-05 14:10:25 +02:00 committed by GitHub
parent 2f011f3cc3
commit 678e3f9c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;