Closed spestana closed 4 months ago
For example, this would print out the json response (and any error messages from the planet API) if the response code isn't OK:
if result.status_code != 200:
print("Planet API response not OK: ", result.json())
Make two error messages to catch no API and incorrect API
Just finished this and merged into main. There's two catches before the main code is run for if there is no API or the API is not a string and using an invalid API.
Currently using data_gathering.api_search with a bad API key does not alert the user that the Planet API has returned an error message (a 401 response).
Instead, a user would not encounter an error until trying to extract geometry features from the returned json:
We should add a feature to the api_search function so that it will alert the user if it returns anything other than a 200 response.