def application(environ, start_response): request = webob.Request(environ) status = '200 OK' headers = [('Content-Type', 'text/html')] start_response(status, headers) yield '<p>Hello world</p>' try: # will raise a NameError about 'bar' not being defined foo = bar except: # report full exception info ratchet.report_exc_info(sys.exc_info(), request) # and/or, just send a string message with a level ratchet.report_message("Here's a message", 'info', request) yield '<p>Caught an exception</p>'
def process_exception(self, request, exc): ratchet.report_exc_info(sys.exc_info(), request)
def handle_error(settings, request): ratchet.report_exc_info(sys.exc_info(), request)