Skip to content

Commit

Permalink
Add logging and proper raise on too many tries
Browse files Browse the repository at this point in the history
  • Loading branch information
alexamici committed May 29, 2024
1 parent 2da64f2 commit 2942527
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xarray_ecmwf/engine_ecmwf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ def retrieve(
with self.retrieve_once(request, override_cache_file) as ds:
yield ds
break
except RuntimeError:
LOGGER.exception("Failed retrieve")
except RuntimeError as ex:
LOGGER.exception(f"Failed retrieve: {try_} / {tries}")
else:
raise RuntimeError(f"too many retries {tries}")

@contextlib.contextmanager
def retrieve_once(
Expand Down

0 comments on commit 2942527

Please sign in to comment.