Replace general exceptions in win32raw

This commit is contained in:
belono 2023-10-26 20:08:16 +02:00
parent 4f05109fd1
commit a97502fe45

View File

@ -153,7 +153,7 @@ class Win32Raw(Escpos):
:type msg: bytes
"""
if self.printer_name is None:
raise Exception("Printer not found")
raise DeviceNotFoundError("Printer not found")
if not self.device:
raise Exception("Printer job not opened")
raise DeviceNotFoundError("Printer job not opened")
win32print.WritePrinter(self.device, msg)