cilynx / pantomath

Pantomath knows about things
GNU General Public License v3.0
1 stars 0 forks source link

Handle scanner I/O errors #21

Open cilynx opened 2 years ago

cilynx commented 2 years ago
14:05:37: Debug: Entering event loop.
14:05:37: Debug: Initializing scanner
Exception in thread Thread-1 (_init_scanner):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "/home/rcw/Repos/pantomath/src/scanner.py", line 81, in _init_scanner
    self.device = sane.open(self.devname)
  File "/usr/lib/python3/dist-packages/sane.py", line 408, in open
    return SaneDev(devname)
  File "/usr/lib/python3/dist-packages/sane.py", line 160, in __init__
    d['dev'] = _sane._open(devname)
_sane.error: Error during device I/O
cilynx commented 2 years ago

This happens when attempting to scan while there's a jam in the ADF -- should maybe prompt the user to check for a jam then confirm all-clear so we can try again.

cilynx commented 2 years ago

Also appears to happen w/o a jam -- should maybe retry once and if we get another I/O error, then prompt the user to clear a potential jam.