diff --git a/parsl/jobs/errors.py b/parsl/jobs/errors.py new file mode 100644 index 0000000000..6d42f429be --- /dev/null +++ b/parsl/jobs/errors.py @@ -0,0 +1,7 @@ +from parsl.errors import ParslError + + +class TooManyJobFailuresError(ParslError): + """Indicates that executor is shut down because of too many block failures. + """ + pass diff --git a/parsl/jobs/simple_error_handler.py b/parsl/jobs/simple_error_handler.py index 72481c6932..c39ef505df 100644 --- a/parsl/jobs/simple_error_handler.py +++ b/parsl/jobs/simple_error_handler.py @@ -4,6 +4,7 @@ import parsl.executors.status_handling as status_handling from parsl.jobs.states import JobStatus, JobState +from parsl.jobs.errors import TooManyJobFailuresError def simple_error_handler(executor: status_handling.BlockProviderExecutor, status: Dict[str, JobStatus], threshold: int): @@ -27,18 +28,25 @@ def _get_error(status: Dict[str, JobStatus]) -> Exception: err = "" count = 1 for js in status.values(): + err = err + f"Error {count}:\n" + count += 1 + if js.message is not None: - err = err + "{}. {}\n".format(count, js.message) - count += 1 + err = err + f"\t{js.message}\n" + + if js.exit_code is not None: + err = err + f"\tEXIT CODE: {js.exit_code}\n" + stdout = js.stdout_summary if stdout: err = err + "\tSTDOUT: {}\n".format(stdout) + stderr = js.stderr_summary if stderr: err = err + "\tSTDERR: {}\n".format(stderr) if len(err) == 0: - err = "[No error message received]" + err = "No error messages received" # wrapping things in an exception here doesn't really help in providing more information # than the string itself - return Exception(err) + return TooManyJobFailuresError(err)