Skip to content

Commit

Permalink
#156: catch all InvalidProductError due to properties not found in me…
Browse files Browse the repository at this point in the history
…tadata
  • Loading branch information
jteulade committed Jun 17, 2024
1 parent 4bdba02 commit f4ead6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eoreader/stac/stac_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def add_to_item(self, item) -> None:
center_wavelength = stac_utils.to_float(band.center_wavelength)
solar_illumination = stac_utils.to_float(band.solar_illumination)
full_width_half_max = stac_utils.to_float(band.full_width_half_max)
except AttributeError:
except (AttributeError, InvalidProductError):
center_wavelength = None
solar_illumination = None
full_width_half_max = None
Expand Down Expand Up @@ -338,7 +338,7 @@ def __init__(self, prod, **kwargs):
# Convert from numpy dtype (which are not JSON serializable) to standard dtype
self.sun_az = stac_utils.to_float(sun_az)
self.sun_el = stac_utils.to_float(sun_el)
except AttributeError:
except (AttributeError, InvalidProductError):
self.sun_az = None
self.sun_el = None

Expand All @@ -349,7 +349,7 @@ def __init__(self, prod, **kwargs):
self.view_az = stac_utils.to_float(view_az)
self.off_nadir = stac_utils.to_float(off_nadir)
self.incidence_angle = stac_utils.to_float(incidence_angle)
except AttributeError:
except (AttributeError, InvalidProductError):
self.view_az = None
self.off_nadir = None
self.incidence_angle = None
Expand Down

0 comments on commit f4ead6f

Please sign in to comment.