From 0aff94cfb39c3ad9c32444525099d9269c49573e Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Sun, 1 Jan 2023 10:55:23 +0700 Subject: [PATCH] Add action error --- backend/src/utils/errors.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/utils/errors.ts b/backend/src/utils/errors.ts index 49afb217a..ba5611465 100644 --- a/backend/src/utils/errors.ts +++ b/backend/src/utils/errors.ts @@ -123,4 +123,14 @@ export const SecretNotFoundError = (error?: Partial) => new stack: error?.stack }); +//* ----->[ACTION ERRORS]<----- +export const ActionNotFoundError = (error?: Partial) => new RequestError({ + logLevel: error?.logLevel ?? LogLevel.ERROR, + statusCode: error?.statusCode ?? 404, + type: error?.type ?? 'action_not_found_error', + message: error?.message ?? 'The requested action was not found', + context: error?.context, + stack: error?.stack +}); + //* ----->[MISC ERRORS]<-----