Replace formatting socket.error by exc_info in network.udp
This commit is contained in:
parent
8ff8e0e2cb
commit
6168d63699
|
@ -125,9 +125,9 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
|
||||||
|
|
||||||
def handle_read(self):
|
def handle_read(self):
|
||||||
try:
|
try:
|
||||||
(recdata, addr) = self.socket.recvfrom(self._buf_len)
|
recdata, addr = self.socket.recvfrom(self._buf_len)
|
||||||
except socket.error as e:
|
except socket.error:
|
||||||
logger.error("socket error: %s", e)
|
logger.error("socket error on recvfrom:", exc_info=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.destination = Peer(*addr)
|
self.destination = Peer(*addr)
|
||||||
|
@ -143,7 +143,7 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
|
||||||
try:
|
try:
|
||||||
retval = self.socket.sendto(
|
retval = self.socket.sendto(
|
||||||
self.write_buf, ('<broadcast>', self.port))
|
self.write_buf, ('<broadcast>', self.port))
|
||||||
except socket.error as e:
|
except socket.error:
|
||||||
logger.error("socket error on sendto: %s", e)
|
logger.error("socket error on sendto:", exc_info=True)
|
||||||
retval = len(self.write_buf)
|
retval = len(self.write_buf)
|
||||||
self.slice_write_buf(retval)
|
self.slice_write_buf(retval)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user