title: Tornado Web custom 404 where path does not exist
body: <p>I am trying to change the native 404 response that Tornado web Application instance gives when it fails to route (or acknowledge Content-Type json). </p>
  
  <p>I could not find documentation to do this, so am right now just adding a final regex that matches everything:</p>
  
  <pre><code>import tornado.web
  
  class BaseHandler(tornado.web.RequestHandler):
      def write_error(self, status_code, **kwargs):
          self.finish({
              'error': {
                  'code': status_code,
                  'message': self._reason,
              }
          })
  
  
  class NotFoundHandler(BaseHandler):
      def get(self, *args, **kwargs):
          raise tornado.web.HTTPError(
              status_code=404,
              reason="Invalid resource path."
          )
  
  
  app = tornado.web.Application([
      (r"/ping", PingHandler),
      # ...
      (r"(.*)", NotFoundHandler),
  ])
  </code></pre>
  
  <p>This feels like a bit of a hack. Is there a way to more globally set this?</p>