Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly Catch exceptions when USB is Removed #54

Open
kb1lqc opened this issue Mar 2, 2018 · 0 comments
Open

Properly Catch exceptions when USB is Removed #54

kb1lqc opened this issue Mar 2, 2018 · 0 comments
Assignees

Comments

@kb1lqc
Copy link
Member

kb1lqc commented Mar 2, 2018

While running the faradayio-cli program with the lates development branch code of faradayio I obtain the following error when I remove the USB cable while the program is running. Note, this does not exit the program.

bryce@bryce-ubuntu:~/Documents/git/faradayio-cli$ sudo .venv/bin/faradayio-cli KB1LQC 1
[sudo] password for bryce: 
Executing faradayio-cli version 0.0.1
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/bryce/Documents/git/faradayio-cli/.venv/lib/python3.5/site-packages/serial/serialposix.py", line 501, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/home/bryce/Documents/git/faradayio-cli/.venv/lib/python3.5/site-packages/faradayio/faraday.py", line 238, in run
    self.checkSerial()
  File "/home/bryce/Documents/git/faradayio-cli/.venv/lib/python3.5/site-packages/faradayio/faraday.py", line 211, in checkSerial
    for item in self.rxSerial(self._TUN._tun.mtu):
  File "/home/bryce/Documents/git/faradayio-cli/.venv/lib/python3.5/site-packages/faradayio/faraday.py", line 193, in rxSerial
    return(self._faraday.receive(length))
  File "/home/bryce/Documents/git/faradayio-cli/.venv/lib/python3.5/site-packages/faradayio/faraday.py", line 77, in receive
    ret = self._serialPort.read(length)
  File "/home/bryce/Documents/git/faradayio-cli/.venv/lib/python3.5/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
@kb1lqc kb1lqc self-assigned this Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant