wazuh-dashboard-plugins
wazuh-dashboard-plugins copied to clipboard
Improve error handling in app
Epic - Improve Error handling
Description The app has a lot of unexpected behaviors due to a bad error handling strategy. Also, it’s really hard to identify a problem due to a lack of proper logging.
Propose We need to improve the next topics:
Frontend:
- Handle all JS errors from components and show them to the user softly.
- Refactor all async returns (promises rejections and resolves) to a unique strategy.
- All errors should be thrown through the logical/business layers adding some metadata (when is necessary) until the presentation layer, who is the one who decides how to react and/or show the error.
- Improve a logging strategy with different log levels and UI representation.
Backend:
- Refactor all async returns (promises rejections and resolves) to a unique strategy.
- All errors should be thrown through the logical/business layers adding some metadata (when is necessary) until the API response layer, through an orchestrator to normalize all error responses.
- Normalize the current use of the logger (easy error detection).
- Improve the current logger to avoid spam logging.
Related issues:
- #4145
- #4297
Closing in favor of #4145