Commit 81f840be authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

add logging incase of exception

Refs: #2148
parent ee1de5e9
......@@ -31,6 +31,8 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
import logging
from traceback import format_exc
from time import time, mktime
from urllib import quote
......@@ -45,6 +47,8 @@ from astakos.im.faults import BadRequest, Unauthorized, InternalServerError
from astakos.im.models import AstakosUser
from astakos.im.settings import CLOUD_SERVICES, INVITATIONS_ENABLED
logger = logging.getLogger(__name__)
def render_fault(request, fault):
if isinstance(fault, InternalServerError) and settings.DEBUG:
fault.details = format_exc(fault)
......@@ -94,6 +98,7 @@ def authenticate(request):
response['Content-Length'] = len(response.content)
return response
except BaseException, e:
logger.exception(e)
fault = InternalServerError('Unexpected error')
return render_fault(request, fault)
......
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