1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-07-15 08:43:30 +00:00

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 :type msg: bytes
""" """
if self.printer_name is None: if self.printer_name is None:
raise Exception("Printer not found") raise DeviceNotFoundError("Printer not found")
if not self.device: if not self.device:
raise Exception("Printer job not opened") raise DeviceNotFoundError("Printer job not opened")
win32print.WritePrinter(self.device, msg) win32print.WritePrinter(self.device, msg)