[Refactor] - Backend Error Handler
Opened this issue · 0 comments
darmsDD commented
Description:
There is on Express a Error Handler that prevents the "try / catch" use (reducing code duplication). Since our backend function have similar try / catch blocks, it's possible to use this error handler function instead. Links to documentation below:
- https://expressjs.com/pt-br/guide/error-handling.html
- https://www.toptal.com/nodejs/node-js-error-handling
Remembering that not all try / catch blocks are equal, for example, the functions which send notification don't stop the function flow on try / catch where it's called, like chooseHelper
, even though one error occurs in notification dispatch this function doesn't stop and the helper has to be chosen.
Acceptance Criteria:
- Remove all try / catch duplications.
Tasks:
- Check which try / catch blocks are similar.
- Verify if there is a damage in remove try / catch abstraction