Skip to content

Commit

Permalink
handle errors more elegantly in xAH_run (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg authored Jun 16, 2017
1 parent 7581470 commit d701bb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion scripts/xAH_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def setalg(self, className, options):
if not hasattr(alg_obj, k) and k not in ['m_msgLevel', 'm_name']:
raise AttributeError(k)
self._log.append((alg, k, v))
setattr(alg_obj, k, v)
try:
setattr(alg_obj, k, v)
except:
logger.error("There was a problem setting {0:s} to {1} for {2:s}::{3:s}".format(k, v, className, algName))
raise

#print

#
Expand Down
6 changes: 5 additions & 1 deletion scripts/xAH_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,11 @@ def parse_json(filename):
if isinstance(config_val, unicode):
config_val = config_val.encode('utf-8')

setattr(alg, config_name, config_val)
try:
setattr(alg, config_name, config_val)
except:
xAH_logger.error("There was a problem setting {0:s} to {1} for {2:s}::{3:s}".format(config_name, config_val, className, algName))
raise

xAH_logger.debug("adding algorithm %s to job", className)
algorithmConfiguration_string.append("\n")
Expand Down

0 comments on commit d701bb8

Please sign in to comment.