In case of unexpected error log the traceback
authorSofia Papagiannaki <papagian@gmail.com>
Sat, 21 Jul 2012 08:01:01 +0000 (11:01 +0300)
committerSofia Papagiannaki <papagian@gmail.com>
Sat, 21 Jul 2012 08:01:01 +0000 (11:01 +0300)
snf-pithos-app/pithos/api/util.py

index ebfc037..03acbee 100644 (file)
@@ -71,7 +71,7 @@ import re
 import hashlib
 import uuid
 import decimal
-
+import traceback
 
 logger = logging.getLogger(__name__)
 
@@ -909,8 +909,9 @@ def api_method(http_method=None, format_allowed=False, user_required=True):
             except Fault, fault:
                 return render_fault(request, fault)
             except BaseException, e:
-                logger.exception('Unexpected error: %s' % e)
-                fault = InternalServerError('Unexpected error: %s' % e)
+               s = traceback.format_exc()
+                logger.exception('Unexpected error: %s' % s)
+                fault = InternalServerError('Unexpected error: %s' % s)
                 return render_fault(request, fault)
             finally:
                 if getattr(request, 'backend', None) is not None: