[bwcompat] log execption even when cubicweb.bwcompat.errorhandler = True (closes #13421901)
authorArthur Lutz <arthur.lutz@logilab.fr>
Thu, 02 Jun 2016 12:11:07 +0200
changeset 11619 be13b3ea71de
parent 11618 3dad592ccb8f
child 11620 2497bcf18030
[bwcompat] log execption even when cubicweb.bwcompat.errorhandler = True (closes #13421901)
pyramid_cubicweb/bwcompat.py
--- 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