HyungnaLim / ITEC2905-Project3

0 stars 1 forks source link

app.py error handling #20

Closed rwalk651 closed 4 weeks ago

rwalk651 commented 1 month ago

Preferably in the way Clara outlines in the Flask introduction video (@ 52:50). Each API will return a tuple of data: (data, error)

For example if the events API works it will return (events_info, None) meaning no errors, and if an error is raised at any point in the call, it will return (None, error) meaning no data and an error message.

This way we only have to deal with one error message at a time on the front end.

Open to suggestions as well if ya'll want to do a different implementation.

HyungnaLim commented 1 month ago

Good thought! I will start revising codes with None instead of creating a SpotifyError class for error handling on spotify api module!

Saphirkitoko commented 1 month ago

@rwalk651 It's good idea!