wadda / gps3

Python 2.7 - 3.5 interface to gpsd
MIT License
76 stars 32 forks source link

Exceptions #11

Open fabaff opened 8 years ago

fabaff commented 8 years ago

I'm working on an integration of GPSD into Home-Assistant.io and using your project.

Have you considered to raise exceptions instead of printing to STDOUT if there is no connection possible or another problem occurs?

wadda commented 8 years ago

It is actually the plan for raised exceptions to roll over and attend to, for example,

These 3 cover essentially all errors for no gpsd, wrong port, no host.

Looking In the gpsd project, you'll see fake.py has a daemon check and a method to respawn an instance of gpsd, but with the introduction of systemd scripts I'm still trying to sort out a process viable in older POSIX systems and the new daemon handling systems. I've not done that yet.

Error handling networked failures is another layer of complexity.

So, currently if it can't, it just tells you the problem rather than attempt 'fixing it'.

But, yeah, the client should roll with the punches, rather than spit you out on the street.