Well, firstly, the _handle_request_exception method is in the RequestHandler , not the Application .
Secondly, you cannot override the associated method with a new definition in the main namespace:
def _handle_request_exception(self, e): logging.error('error')
You need to subclass the RequestHandler class:
class BaseHandler(tornado.web.RequestHandler): def _handle_request_exception(self, e): logging.error('error')
all your handlers should then inherit from BaseHandler .
source share