add additional logging on the server so we can track unexpected exceptions

This commit is contained in:
Shane Caraveo 2010-11-11 15:01:03 -08:00
Родитель f2c5939277
Коммит 1b8ec3478c
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -27,6 +27,7 @@ import urlparse
import json
import httplib2
import oauth2 as oauth
import logging
from pylons import config, request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
@ -37,7 +38,7 @@ from twitter.oauth import OAuth
from twitter.api import Twitter, TwitterHTTPError
domain = 'twitter.com'
log = logging.getLogger(domain)
def twitter_to_poco(user):
# example record
@ -168,7 +169,8 @@ class api():
except ValueError, ee:
# sometimes the error does not contain a json object, lets
# try to see what it is
msg = str(exc)
msg = "%r" % (exc,)
log.exception(exc)
error = {'provider': domain,
'message': msg,
'status': exc.e.code