Skip to content

Commit

Permalink
Merge pull request #1610 from pyiron/tablerr
Browse files Browse the repository at this point in the history
Catch all exception in pyiron table
  • Loading branch information
pmrv committed Aug 20, 2024
2 parents 9f099e6 + 707c5d2 commit 0b7924c
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions pyiron_base/jobs/datamining.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,9 @@ def always_true(_):
return True


def _apply_function_on_job(funct, job):
try:
return funct(job)
except (ValueError, TypeError):
return {}


def _apply_list_of_functions_on_job(input_parameters):
from pyiron_snippets.logger import logger

from pyiron_base.jobs.job.path import JobPath

db_entry, function_lst, convert_to_object = input_parameters
Expand All @@ -861,7 +856,8 @@ def _apply_list_of_functions_on_job(input_parameters):
job.set_input_to_read_only()
diff_dict = {}
for funct in function_lst:
funct_dict = _apply_function_on_job(funct, job)
for key, value in funct_dict.items():
diff_dict[key] = value
try:
diff_dict.update(funct(job))
except Exception as e:
logger.warn(f"Caught exception '{e}' when called on job {job.id}!")
return diff_dict

0 comments on commit 0b7924c

Please sign in to comment.