Commit 2c556b65 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Add stdout/stderr to printing error messages

/close #169
parent e4051d62
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment