Skip to content

Commit 9d33cc3

Browse files
committed
Catch only socket.error because other errors should be handled by application
1 parent c11315b commit 9d33cc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fluent/sender.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(self,
5151

5252
try:
5353
self._reconnect()
54-
except Exception:
54+
except socket.error:
5555
# will be retried in emit()
5656
self._close()
5757

@@ -101,7 +101,7 @@ def _send_internal(self, bytes_):
101101

102102
# send finished
103103
self.pendings = None
104-
except Exception:
104+
except socket.error as e:
105105
# close socket
106106
self._close()
107107
# clear buffer if it exceeds max bufer size

0 commit comments

Comments
 (0)