add additional logging on the server so we can track unexpected exceptions
This commit is contained in:
Родитель
f2c5939277
Коммит
1b8ec3478c
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче