Permalink
Browse files

Add error traceback to logging

  • Loading branch information...
1 parent d9ae094 commit 3f1d2e85255b46bad4004bff9eba3b98093a8d2d @qwghlm committed May 12, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 whensmytransport.py
View
@@ -23,6 +23,7 @@
import logging
import os
import re
+import traceback
from pprint import pprint # For debugging
# From library modules in this package
@@ -122,6 +123,8 @@ def check_tweets(self):
except WhensMyTransportException as exc:
replies = (exc.get_user_message(),)
except Exception as exc:
+ logging.error("Exception encountered: %s", exc.__class__.__name__)
+ logging.error("Traceback:\r\n%s" % traceback.format_exc())
self.alert_admin_about_exception(tweet, exc.__class__.__name__)
replies = (WhensMyTransportException('unknown_error').get_user_message(),)

0 comments on commit 3f1d2e8

Please sign in to comment.