Skip to content

Commit

Permalink
refactor(errors): display error code before message
Browse files Browse the repository at this point in the history
  • Loading branch information
IdoBouskila committed Aug 18, 2024
1 parent 57b62ce commit 02d4ce0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/validationExceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 02d4ce0

Please sign in to comment.