diff --git a/snakemake_executor_plugin_slurm/__init__.py b/snakemake_executor_plugin_slurm/__init__.py index d822ef8..64502de 100644 --- a/snakemake_executor_plugin_slurm/__init__.py +++ b/snakemake_executor_plugin_slurm/__init__.py @@ -366,9 +366,15 @@ def run_job(self, job: JobExecutorInterface): process.returncode, call, output=err ) except subprocess.CalledProcessError as e: - raise WorkflowError( - f"SLURM sbatch failed. The error message was {e.output}" + self.report_job_error( + SubmittedJobInfo(job), + msg=( + "SLURM sbatch failed. " + f"The error message was '{e.output.strip()}'.\n" + f" sbatch call:\n {call}\n" + ), ) + return # any other error message indicating failure? if "submission failed" in err: raise WorkflowError( @@ -445,7 +451,7 @@ async def check_active_jobs( # We use this sacct syntax for argument 'starttime' to keep it compatible # with slurm < 20.11 - sacct_starttime = f"{datetime.now() - timedelta(days = 2):%Y-%m-%dT%H:00}" + sacct_starttime = f"{datetime.now() - timedelta(days=2):%Y-%m-%dT%H:00}" # previously we had # f"--starttime now-2days --endtime now --name {self.run_uuid}" # in line 218 - once v20.11 is definitively not in use any more,