inspectorG4dget / AnonymousFeedback

1 stars 0 forks source link

Handle errors in UI #79

Open cannotparse opened 7 years ago

cannotparse commented 7 years ago

Related to #77

If an error is returned use a sort of "modal" like popup to notify the user that something went wrong.

scriptbae commented 7 years ago

Counterpoint: this is something that's unlikely to be caused by the software itself (since AFAIK the student, by default, will only have a list of courses available to them). So, this is only likely to exist as an edgecase when a student deliberately crafts bad API requests (either using something like cURL or by modifying the page source to add options to the dropdown).

Because this is outside of normal application behaviour, IMO it would be sufficient to have the API return an HTTP 403 without the client-side code modifying the UI (maybe just throwing up a console.warn or something of that sort).

Thoughts?

inspectorG4dget commented 7 years ago

My concern is that if a DB query fails from the UI, then a 403 takes the user out of the UI. A modal is dismissable, allowing the user to return to the UI with their input fields already filled out, so that they can (after possibly make any required edits) and just hit the submit button again