Replace wrong exception in cups

This commit is contained in:
belono 2023-10-26 20:45:29 +02:00
parent a97502fe45
commit 5b6be2bb2d

View File

@ -172,9 +172,9 @@ class CupsPrinter(Escpos):
self.pending_job = True
try:
self.tmpfile.write(msg)
except ValueError:
except TypeError:
self.pending_job = False
raise ValueError("Printer job not opened")
raise TypeError("Bytes required. Printer job not opened")
def send(self):
"""Send the print job to the printer."""