From 02d4ce082fe277f48db286ec242fd79eded6aad6 Mon Sep 17 00:00:00 2001 From: Ido Bouskila Date: Sun, 18 Aug 2024 19:06:09 +0300 Subject: [PATCH] refactor(errors): display error code before message --- src/utils/validationExceptions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/validationExceptions.ts b/src/utils/validationExceptions.ts index 58adb23..08d0f0a 100644 --- a/src/utils/validationExceptions.ts +++ b/src/utils/validationExceptions.ts @@ -11,8 +11,8 @@ export const throwSizeError = ({ type, validationType, requiredLength }: { : `String must contain at ${ isMinimum ? 'least' : 'most' } ${ String(requiredLength) } character(s)`; const error = { - message: errorMessage, code: isMinimum ? 'too_small' : 'too_big', + message: errorMessage, }; throw new Error(JSON.stringify(error));