Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
merge hotfix for exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
licenseplated committed Jun 9, 2017
2 parents 517068e + 27fcdc3 commit 74d6c4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions traptor/traptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from tenacity import retry, wait_exponential, stop_after_attempt, retry_if_exception_type, wait_chain, wait_fixed

from dog_whistle import dw_config, dw_callback
from requests.exceptions import ChunkedEncodingError

from scutils.log_factory import LogFactory
from scutils.stats_collector import StatsCollector
from traptor_limit_counter import TraptorLimitCounter
Expand Down Expand Up @@ -1101,8 +1103,17 @@ def run(self):

self.restart_flag = False

# Start collecting data
self._main_loop()
try:
# Start collecting data
self._main_loop()
except ChunkedEncodingError as e:
self.logger.error("Ran into a ChunkedEncodingError while processing "
"tweets. Restarting Traptor from top of main process "
"loop", {
'ex' : traceback.format_exc()
})




def main():
Expand Down Expand Up @@ -1193,7 +1204,7 @@ def main():

dd_monitoring.increment('traptor_error_occurred',
tags=['error_type:traptor_start'])

raise e

if __name__ == '__main__':
from raven import Client
Expand Down
2 changes: 1 addition & 1 deletion traptor/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.4.12.0'
__version__ = '1.4.12.1'

if __name__ == '__main__':
print(__version__)

0 comments on commit 74d6c4d

Please sign in to comment.