From ea7ad5481a4ab08c750a172979fe6fd22b4be0f1 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 13 Oct 2020 16:26:59 -0400 Subject: [PATCH] Add unprocessable entity exception --- api/src/exceptions/index.ts | 1 + api/src/exceptions/unprocessable-entity.ts | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 api/src/exceptions/unprocessable-entity.ts diff --git a/api/src/exceptions/index.ts b/api/src/exceptions/index.ts index 509b374a8f..a10b49202c 100644 --- a/api/src/exceptions/index.ts +++ b/api/src/exceptions/index.ts @@ -9,3 +9,4 @@ export * from './invalid-payload'; export * from './invalid-query'; export * from './route-not-found'; export * from './service-unavailable'; +export * from './unprocessable-entity'; diff --git a/api/src/exceptions/unprocessable-entity.ts b/api/src/exceptions/unprocessable-entity.ts new file mode 100644 index 0000000000..6fe580d5ea --- /dev/null +++ b/api/src/exceptions/unprocessable-entity.ts @@ -0,0 +1,7 @@ +import { BaseException } from './base'; + +export class UnprocessableEntityException extends BaseException { + constructor(message: string) { + super(message, 422, 'UNPROCESSABLE_ENTITY'); + } +}