Skip to content

Commit

Permalink
Print more useful error messages in case of exceptions in tasks (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoRoth authored and fmaussion committed Mar 11, 2018
1 parent bb4dc84 commit 70b9f06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions oggm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2449,9 +2449,9 @@ def _entity_task(gdir, reset=None, print_log=True, **kwargs):
gdir.log(task_name, err=err)
pipe_log(gdir, task_name, err=err)
if print_log:
self.log.error('%s occurred during task %s on %s!',
self.log.error('%s occurred during task %s on %s: %s',
type(err).__name__, task_name,
gdir.rgi_id)
gdir.rgi_id, str(err))
if not cfg.PARAMS['continue_on_error']:
raise
return out
Expand Down
2 changes: 1 addition & 1 deletion oggm/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __call__(self, gdir):
except Exception as e:
try:
err_msg = '({0}) exception occured while processing task ' \
'{1}'.format(gdir.rgi_id, self.call_func.__name__)
'{1}: {2}'.format(gdir.rgi_id, self.call_func.__name__, str(e))
raise RuntimeError(err_msg) from e
except AttributeError:
pass
Expand Down

0 comments on commit 70b9f06

Please sign in to comment.