From d75b39f6dfd615fb0a6b47ed3177d96c1fe1fa04 Mon Sep 17 00:00:00 2001 From: Richard Liaw Date: Thu, 28 Jun 2018 20:23:38 -0700 Subject: [PATCH] [tune] Return error trials(#2292) --- python/ray/tune/tune.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/ray/tune/tune.py b/python/ray/tune/tune.py index 7660075aa..ac3d9cae0 100644 --- a/python/ray/tune/tune.py +++ b/python/ray/tune/tune.py @@ -95,10 +95,13 @@ def run_experiments(experiments, print(runner.debug_string(max_debug=99999)) + errored_trials = [] for trial in runner.get_trials(): - # TODO(rliaw): What about errored? if trial.status != Trial.TERMINATED: - raise TuneError("Trial did not complete", trial) + errored_trials += [trial] + + if errored_trials: + raise TuneError("Trials did not complete", errored_trials) wait_for_log_sync() return runner.get_trials()