Skip to content

Commit

Permalink
Merge pull request #159 from papr/handle-beacon-socket-fail
Browse files Browse the repository at this point in the history
Gracefully handle issues during zbeacon socket preparations
  • Loading branch information
keent authored Jul 29, 2021
2 parents e9fac19 + 09cd753 commit 7e8f388
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyre/zbeacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def __del__(self):
self.udpsock.close()

def prepare_udp(self):
self._prepare_socket()
try:
self._prepare_socket()
except ValueError:
logger.exception("Error preparing socket:")
return
try:
self.udpsock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
self.udpsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
Expand Down

0 comments on commit 7e8f388

Please sign in to comment.