The current class calls quit() when the connection fails. This works poorly when integrated into other processes that might want to do custom error handling. It would be better to raise an exception (possibly ConnectionError or a custom error), and then the calling application can do better error handling.
This should be a simple change (replace both instances of quit() with e.g. raise ConnectionError("Failed to connect to Tobii device")). I can submit a PR if that's useful, assuming you can determine the appropriate exception type.
The current class calls
quit()
when the connection fails. This works poorly when integrated into other processes that might want to do custom error handling. It would be better to raise an exception (possibly ConnectionError or a custom error), and then the calling application can do better error handling.This should be a simple change (replace both instances of
quit()
with e.g.raise ConnectionError("Failed to connect to Tobii device")
). I can submit a PR if that's useful, assuming you can determine the appropriate exception type.