Amsterdam-Music-Lab / MUSCLE

An application to easily set up and run online listening experiments for music research.
https://www.amsterdammusiclab.nl/
MIT License
4 stars 1 forks source link

Validate output of rules' `next_round` functions #779

Open BeritJanssen opened 8 months ago

BeritJanssen commented 8 months ago

We currently don't have any way of catching that next_round arrays are empty, before sending them to the frontend. We should work on validation, and throwing descriptive errors for empty arrays. Moreover, the first action should always be an action with a button (Explainer / Info), so the user interacts with the document before the experiment begins.

drikusroor commented 8 months ago

Should these be http exceptions thrown by python (I'm thinking of a 422 - unprocessable entity) or will the request still be a 200 albeit with a custom error object format? Do we have a format or convention for returning server errors?

BeritJanssen commented 8 months ago

I think we should be throwing an error, with a descriptive error message. Something like Django's HttpResponseServerError, but other responses / error codes may indeed be more appropriate.

BeritJanssen commented 4 months ago

Blocked by #928.