# if parent excplicitely returns a plain response, then we don't touch it
return response
except Exception, e:
+ if openerp.tools.config['dev_mode'] and (not isinstance(exception, ir_qweb.QWebException) or not exception.qweb.get('cause')):
+ raise
exception = e
values = dict(
def _handle_exception(self, exception):
# If handle_exception returns something different than None, it will be used as a response
+
+ # Don't handle exception but use werkeug debugger if server in --dev mode
+ if openerp.tools.config['dev_mode']:
+ raise
try:
return request._handle_exception(exception)
except openerp.exceptions.AccessDenied:
if processing:
return processing
-
# set and execute handler
try:
request.set_handler(func, arguments, auth_method)
import unittest2
import werkzeug.serving
+from werkzeug.debug import DebuggedApplication
if os.name == 'posix':
# Unix only for workers
watcher.start()
else:
_logger.warning("'watchdog' module not installed. Code autoreload feature is disabled")
+ server.app = DebuggedApplication(server.app, evalex=True)
rc = server.run(preload, stop)