HyungnaLim / ITEC2905-Project3

0 stars 1 forks source link

App.py error handling #24

Closed rwalk651 closed 1 month ago

rwalk651 commented 1 month ago

Starting to build upon returning a tuple from our API's. Retains variables for Spotify and Ticketmaster as not to break the app. To test just delete the developer key or change the service_name string to whatever in youtube_api.py

Below is an example. If the for-loop is successful, video data and no error message is returned. When an exception is thrown, the function returns (None, err_msg), as in, video data does not exist, but an error message does.

Screenshot 2024-10-24 181131

app.py will check if an error message exists, then pass the message on to the relevant html.

image

Screenshot 2024-10-24 1811312

Since the YouTube video isn't necessarily required, this can be changed later to just be a message in search_result.html as well as logged.

rwalk651 commented 1 month ago

Merged to #14 to start developing unit tests.