File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,11 @@ def run(self):
2626 log .info ("Starting event consumer" )
2727 self ._running = True
2828 while self ._running :
29- self .send ()
29+ try :
30+ self .send ()
31+ except Exception :
32+ log .exception (
33+ 'Unhandled exception in event consumer' )
3034
3135 def stop (self ):
3236 self ._running = False
@@ -53,11 +57,12 @@ def do_send(should_retry):
5357 data = json_body )
5458 r .raise_for_status ()
5559 except ProtocolError as e :
56- inner = e .args [1 ]
57- if inner .errno == errno .ECONNRESET and should_retry :
58- log .warning (
59- 'ProtocolError exception caught while sending events. Retrying.' )
60- do_send (False )
60+ if e .args is not None and len (e .args ) > 1 and e .args [1 ] is not None :
61+ inner = e .args [1 ]
62+ if inner .errno is not None and inner .errno == errno .ECONNRESET and should_retry :
63+ log .warning (
64+ 'ProtocolError exception caught while sending events. Retrying.' )
65+ do_send (False )
6166 else :
6267 log .exception (
6368 'Unhandled exception in event consumer. Analytics events were not processed.' )
You can’t perform that action at this time.
0 commit comments