polubis / 4markdown

16 stars 3 forks source link

[Feature] Unify error handling on BE/FE #428

Open polubis opened 1 month ago

polubis commented 1 month ago

Context

Currently, some of our endpoints use "old" error objects, while others use "new" error objects. This inconsistency creates challenges in reducing technical debt. We need to adopt the "new" approach for all endpoints.

DoD

  1. There is no regression in error handling across the entire application.
  2. The new error model is applied to all endpoints.
  3. The case with showing - "Cannot change the document because it's changed on another device", is working for all type of modification on document. Same for user-profile.
  4. There is no weird or missing error messages - for example if we trying to trigger "already created" error when creating document, it shows such message.
  5. The errors that are triggered after certain interactions - like already exists, invalid field or others - are displayed correcly.
  6. The error - generic one, when there is no internet, looks good too.

PS: Remember to clear added documents - permanent ones after testing.

polubis commented 1 month ago

BE: https://github.com/polubis/greenonsoftware-api/pull/36

polubis commented 1 month ago

FE: https://github.com/polubis/4markdown/pull/431

polubis commented 1 month ago

Can be tested here: https://soft-pithivier-093469.netlify.app/

polubis commented 1 month ago

BE 2: https://github.com/polubis/greenonsoftware-api/pull/37

polubis commented 1 month ago

FE 2:https://github.com/polubis/4markdown/pull/437

polubis commented 1 month ago

Can be tested here: https://soft-pithivier-093469.netlify.app/

MajaWielechowska commented 1 month ago

💚Everything looks and works fine