tournesol-app / tournesol

Free and open source code of the https://tournesol.app platform. Meet the community on Discord https://discord.gg/WvcSG55Bf3
https://tournesol.app
Other
331 stars 48 forks source link

[back] fix: API comparisons should return 400 instead of 500 #2002

Closed GresilleSiffle closed 3 months ago

GresilleSiffle commented 3 months ago

related issues #2001


Description

Instead of returning a HTTP 500 error, the API now returns a proper HTTP 400 Bad Request when a user submits a comparison with an invalid score_max.

The comparison UI is able to display the error messages from the API, so I translated the messages to make them match the front end UI language. As long as the front end correctly sets the score_max of each criterion these messages shouldn't be displayed to the users.

Checklist