wazuh-dashboard-plugins icon indicating copy to clipboard operation
wazuh-dashboard-plugins copied to clipboard

Improve error handling in app

Open frankeros opened this issue 3 years ago • 1 comments

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.

frankeros avatar May 19 '21 12:05 frankeros

Related issues:

  • #4145
  • #4297

AlexRuiz7 avatar Jun 28 '22 16:06 AlexRuiz7

Closing in favor of #4145

gdiazlo avatar Mar 16 '23 13:03 gdiazlo