From 7823f919f17cb2ecb888268d543e36a6f0f9e3f6 Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Tue, 27 Sep 2022 22:08:04 +0200 Subject: [PATCH] DockQ binding: improve error handling --- modules/bindings/pymod/dockq.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/bindings/pymod/dockq.py b/modules/bindings/pymod/dockq.py index e761c845d..ff920f627 100644 --- a/modules/bindings/pymod/dockq.py +++ b/modules/bindings/pymod/dockq.py @@ -272,13 +272,17 @@ def DockQ(dockq_exec, mdl, ref, mdl_ch1, mdl_ch2, ref_ch1, proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - shutil.rmtree(tmp_dir) # cleanup, no matter if DockQ executed successfully + shutil.rmtree(tmp_dir) # cleanup, no matter if DockQ executed successfully if proc.returncode != 0: raise RuntimeError("DockQ run failed - returncode: " + \ - str(proc.return_code)) + str(proc.returncode) + ", stderr: " + \ + proc.stderr.decode() + ", stdout: " + \ + proc.stdout.decode()) if proc.stderr.decode() != "": - raise RuntimeError("DockQ run failed - stderr: " + proc.stderr.decode()) + raise RuntimeError("DockQ run failed - stderr: " + \ + proc.stderr.decode() + ", stdout: " + \ + proc.stdout.decode()) return DockQResult.FromDockQOutput(proc.stdout.decode()) -- GitLab