-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: creating error class #67
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
ef4054e
to
51046aa
Compare
@Joel-leal you got conflicting files here when compared to main Please solve it by doing the following: In this branch, run Finally, push force to your branch. Let me know if you need any help 🙏🏼 |
src/packages/DAO/elections.dao.ts
Outdated
if (!parsedData.success) { | ||
throw new BadRequestError(parsedData.error.name); | ||
} | ||
const electionExist = await findByNameOrStatus(parsedData.data); // Error duplicate data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add to your PR samples on how the error messages are looking in case of a failed parse please?
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand what you meant by this. I modified the error message so that the BadRequestError has its own message instead of just relying on the error message from Zod. Could you provide more context about what you're asking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here 7a991c7
0ab3fe3
to
aa65be7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean! 🚢
Description
Handling errors in the back-end is essential to ensure system stability, provide clear responses to users, prevent sensitive information leaks, and facilitate the identification and resolution of issues during development and maintenance.
Changes
(list of the changes been made)
Notes
(leave here a few notes that could be useful to the reviewers)
I created an Error component for error handling in the backend
I did some error handling implementations using the errors component. With the change in architecture I did not change the routes file but rather the elections.dao file
Board issue