NIAEFEUP / tts-be

A platform where students can experiment with the possible combination of schedule options they can pick at the start of the semester
https://tts.niaefeup.pt
5 stars 1 forks source link

Handle response errors #80

Open thePeras opened 3 months ago

thePeras commented 3 months ago

A quick note is that no other endpoint is handling errors by returning the correct HTTP status code. For example, the the course endpoint does not return the correct HTTP status code if the year is not found.

I added a response/errors.py folder in order to report a 404 not found error with a custom message for the course unit id not being found (`e.g. the first() method returns None)

This folder is a start of an attempt of introducing that kind of behaviour to our API.

_Originally posted by @tomaspalma in https://github.com/NIAEFEUP/tts-be/pull/78#discussion_r1630363844_