Skip to content
Snippets Groups Projects

Catch sbatch errors in CLI commands

Files
4
@@ -96,7 +96,10 @@ def submit_batch(**kwargs):
# delay should fix that
time.sleep(random.uniform(1,5))
subprocess.run(['sbatch'],input=script,shell=True,text=True)
try:
subprocess.run(['sbatch'],input=script,shell=True,text=True,check=True,capture_output=True)
except subprocess.CalledProcessError as e:
raise subprocess.CalledProcessError(e.stderr.decode())
pass
def submit_tld_groups(df,grp_dir,args):
Loading