Skip to content
Snippets Groups Projects
Commit 2c556b65 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Add stdout/stderr to printing error messages

/close #169
parent e4051d62
No related branches found
No related tags found
No related merge requests found
...@@ -637,9 +637,9 @@ def print_file_async(filename, protocol_id): ...@@ -637,9 +637,9 @@ def print_file_async(filename, protocol_id):
for option in config.PRINTING_PRINTERS[protocol.protocoltype.printer]: for option in config.PRINTING_PRINTERS[protocol.protocoltype.printer]:
command.extend(["-o", '"{}"'.format(option) if " " in option else option]) command.extend(["-o", '"{}"'.format(option) if " " in option else option])
command.append(filename) command.append(filename)
subprocess.check_call(command, universal_newlines=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) subprocess.check_output(command, universal_newlines=True, stderr=subprocess.STDOUT)
except subprocess.SubprocessError: except subprocess.SubprocessError as exception:
error = protocol.create_error("Printing", "Printing {} failed.".format(protocol.get_identifier()), "") error = protocol.create_error("Printing", "Printing {} failed.".format(protocol.get_identifier()), exception.stdout)
db.session.add(error) db.session.add(error)
db.session.commit() db.session.commit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment