Imageomics / Andromeda

A website that enables users to explore high-dimensional image data
http://andromeda.imageomics.org/
MIT License
2 stars 1 forks source link

Improve error message when observation date/time is missing #59

Closed johnbradley closed 1 year ago

johnbradley commented 1 year ago

When a user fetches iNaturalist observations and one is missing the observed_on timestamp value the application returns a generic Server Encountered Error message. Improve this error message to let the user know that they must fix the Observed value for one of their observations.

Here is the error from the server logs when this issue occurs:

  File "/api/main.py", line 115, in get_inaturalist
    observations = get_inaturalist_observations(user_id=user_id,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/api/inaturalist.py", line 64, in get_inaturalist_observations
    observed_on.hour * 3600 + observed_on.minute * 60 + observed_on.second
    ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'hour'