I am currently using the following to raise a HTTP bad request:
raise tornado.web.HTTPError(400)
which returns a html output:
&
Also you can override get_error_html method in your handler. For example:
import tornado.web class CustomHandler(tornado.web.RequestHandler): def get_error_html(self, status_code, **kwargs); self.write("404!") ... def get(self): ...