kiesraad / abacus

Abacus, software voor verkiezingsuitslagen en zetelverdeling
https://kiesraad-abacus.pages.dev
European Union Public License 1.2
7 stars 2 forks source link

Make IncorrectCandidatesList, OutOfRange errors a 422 response instead #188

Closed jschuurk-kr closed 1 month ago

jschuurk-kr commented 1 month ago

When the backend response contains an IncorrectCandidatesList error, this is not shown in the frontend.

This error happens when a data entry request for a polling station contains lists or candidates that don't match the election data in the backend.

response body for mock in test:

{"validation_results":{"errors":[{"fields":["data.political_group_votes"],"code":"IncorrectCandidatesList"}],"warnings":[]}}
praseodym commented 1 month ago

This should never happen during normal user interaction. I'm considering removing this from the user-facing validation logic and returning a 422 error status code from the backend instead.

Lionqueen94 commented 1 month ago

This should never happen during normal user interaction. I'm considering removing this from the user-facing validation logic and returning a 422 error status code from the backend instead.

We could technically do the same for the OutOfRange error as well, since the same statement rings true for that one.