Commit 356de5b9 authored by Rémy Decoupes's avatar Rémy Decoupes
Browse files

catch unexpected error on stream

parent 4785d995
......@@ -151,10 +151,13 @@ if __name__ == '__main__':
# Could not filter on both ("AND") account AND hashtag because Twitter's API query only implements "OR"
# stream.filter(follow=accounttofollowedlist, track=hashtagtrackedList)
stream.filter(follow=accounttofollowedlist)
except KeyboardInterrupt as e:
except KeyboardInterrupt:
logger.info("Stream Keyboard Interrupt")
logger.info("Collect tweets : proceeded normally")
except:
logger.error("Unexpected error: ", sys.exc_info()[0])
logger.info("Collect tweets : aborted")
finally:
stream.disconnect()
tweetoutput.close()
logger.info("Collect tweets : proceeded normally")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment