[bwcompat] log execption even when cubicweb.bwcompat.errorhandler = True (closes #13421901)
--- a/pyramid_cubicweb/bwcompat.py Fri May 27 10:49:27 2016 +0200
+++ b/pyramid_cubicweb/bwcompat.py Thu Jun 02 12:11:07 2016 +0200
@@ -1,4 +1,5 @@
import sys
+import logging
from pyramid import security
from pyramid import tweens
@@ -16,6 +17,9 @@
from pyramid_cubicweb.core import cw_to_pyramid
+log = logging.getLogger(__name__)
+
+
class PyramidSessionHandler(object):
"""A CW Session handler that rely on the pyramid API to fetch the needed
informations.
@@ -145,6 +149,7 @@
content = vreg['views'].main_template(req, template, view=errview)
except Exception:
content = vreg['views'].main_template(req, 'error-template')
+ log.exception(exc)
request.response.body = content
return request.response