Ben-Avrahami / Tindira

0 stars 1 forks source link

Replace Non-Indicative Error Messages in Backend #75

Closed yonisimian closed 4 months ago

yonisimian commented 4 months ago

Some backend functions return errors that are not indicative and do not help users / frontend identify errors.

Example: https://github.com/Ben-Avrahami/Tindira/blob/f1b415efc6a6f3c45fcda0a556915c36eb76347e/Tindira-Server/Lambda-Functions/Log-in/service/login.js#L81

That line should be changed to message: error.message, such that the relevant error message is transmitted to the frontend; in our case, that message appears to be thrown via line 129 of the same file: https://github.com/Ben-Avrahami/Tindira/blob/f1b415efc6a6f3c45fcda0a556915c36eb76347e/Tindira-Server/Lambda-Functions/Log-in/service/login.js#L129

The non-indicative messages also appear on other code segments in backend, e.g.: https://github.com/Ben-Avrahami/Tindira/blob/f1b415efc6a6f3c45fcda0a556915c36eb76347e/Tindira-Server/Lambda-Functions/Log-in/service/register.js#L71

Please fix lines 81 and 71 with message: error.message, as described above, and if you find more try-catch blocks that override indicative error messages you may fix them as well.

@BenArtzi4 @morsimha @OmerK100

This issue is not urgent, but has already blocked the frontend team for over a week, so a fixture will be much appreciated :)