Skip to content

Commit

Permalink
#30: treat different errors correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenwh committed Jul 10, 2019
1 parent b3ef221 commit 5071a7c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions geospaas_wind/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ def process(self, uri, force=False, *args, **kwargs):
try:
w = wind_from_sar_and_arome_forecast(uri)
except (TooHighResolutionError, PolarizationError, ObjectDoesNotExist) as e:
try:
if type(e)==Dataset.DoesNotExist:
warnings.warn(uri+': '+e.args[0])
else:
# ObjectDoesNotExist could happen if there is no overlap between SAR and model
warnings.warn(e.file + ': ' + e.msg)
except AttributeError:
import ipdb
ipdb.set_trace()
warnings.warn(e)
return None, False

metadata = w.get_metadata()
Expand Down

0 comments on commit 5071a7c

Please sign in to comment.