From 2c556b654f241b4135154e8609bb7a30e3585913 Mon Sep 17 00:00:00 2001 From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de> Date: Sat, 17 Feb 2018 18:27:10 +0100 Subject: [PATCH] Add stdout/stderr to printing error messages /close #169 --- tasks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks.py b/tasks.py index 6dc8366..b5c4818 100644 --- a/tasks.py +++ b/tasks.py @@ -637,9 +637,9 @@ def print_file_async(filename, protocol_id): for option in config.PRINTING_PRINTERS[protocol.protocoltype.printer]: command.extend(["-o", '"{}"'.format(option) if " " in option else option]) command.append(filename) - subprocess.check_call(command, universal_newlines=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - except subprocess.SubprocessError: - error = protocol.create_error("Printing", "Printing {} failed.".format(protocol.get_identifier()), "") + subprocess.check_output(command, universal_newlines=True, stderr=subprocess.STDOUT) + except subprocess.SubprocessError as exception: + error = protocol.create_error("Printing", "Printing {} failed.".format(protocol.get_identifier()), exception.stdout) db.session.add(error) db.session.commit() -- GitLab