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.
app.py will check if an error message exists, then pass the message on to the relevant html.
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.
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 inyoutube_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.
app.py
will check if an error message exists, then pass the message on to the relevant html.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.