code: def wsgi(self, environ, start_response):
          
          try:
              environ['bottle.app'] = self
              request.bind(environ)
              response.bind()
              out = self._cast(self._handle(environ), request, response)
              # rfc2616 section 4.3
              if response._status_code in (100, 101, 204, 304)\
              or request.method == 'HEAD':
                  if hasattr(out, 'close'): out.close()
                  out = []
              start_response(response._status_line, list(response.iter_headers()))
              return out
          except (KeyboardInterrupt, SystemExit, MemoryError):
              raise
          except Exception, e:
              if not self.catchall: raise
              err = '<h1>Critical error while processing request: %s</h1>' \
                    % html_escape(environ.get('PATH_INFO', '/'))
              if DEBUG:
                  err += '<h2>Error:</h2>\n<pre>\n%s\n</pre>\n' \
                         '<h2>Traceback:</h2>\n<pre>\n%s\n</pre>\n' \
                         % (html_escape(repr(e)), html_escape(format_exc(10)))
              environ['wsgi.errors'].write(err)
              headers = [('Content-Type', 'text/html; charset=UTF-8')]
              start_response('500 INTERNAL SERVER ERROR', headers)
              return [tob(err)]
docs: The bottle WSGI-interface.