clcr / pyeo

Python Earth Observation processing chain
GNU General Public License v3.0
93 stars 30 forks source link

Dataspace search error catch #96

Closed Matthew-J-Payne closed 11 months ago

Matthew-J-Payne commented 11 months ago

The problem: UnboundLocalError: local variable 'dataspace_change_products_all' referenced before assignment

The cause: query_dataspace_by_polygon was returning blank if no products matched the query (rightfully so), this meant that the line response_dataframe = pd.DataFrame.from_records(response_dataframe["properties"]) could not succeed and so dataspace_change_products_all could not be created.

The double-checking:

The solution: added a check that if no products are in response_dataframe, then print a verbose error to the log and sys.exit(1).