How to exit the service (to try again later) in an exception without 
crashing the main WeeWx process?

Let's say, I want to connect to a host:
   def connect(self):
        try:
            self.hp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.hp.connect(self.host, self.port)
        except socket.error as e:
            logerr("Error: connection failed {}".format(e))
            self.hp.close()


 
Now, in case of an exception, I would like to return gracefully to the main 
WeeWx thread without crashing it and try on the next archive interval.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/1ed99eeb-426e-4c6a-a4e2-90bc2b6566ea%40googlegroups.com.

Reply via email to