MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _handle

Method _handle

thirdparty/bottle/bottle.py:966–1014  ·  view source on GitHub ↗
(self, environ)

Source from the content-addressed store, hash-verified

964 return tob(template(ERROR_PAGE_TEMPLATE, e=res, template_settings=dict(name='__ERROR_PAGE_TEMPLATE')))
965
966 def _handle(self, environ):
967 path = environ['bottle.raw_path'] = environ['PATH_INFO']
968 if py3k:
969 environ['PATH_INFO'] = path.encode('latin1').decode('utf8', 'ignore')
970
971 environ['bottle.app'] = self
972 request.bind(environ)
973 response.bind()
974
975 try:
976 while True: # Remove in 0.14 together with RouteReset
977 out = None
978 try:
979 self.trigger_hook('before_request')
980 route, args = self.router.match(environ)
981 environ['route.handle'] = route
982 environ['bottle.route'] = route
983 environ['route.url_args'] = args
984 out = route.call(**args)
985 break
986 except HTTPResponse as E:
987 out = E
988 break
989 except RouteReset:
990 depr(0, 13, "RouteReset exception deprecated",
991 "Call route.call() after route.reset() and "
992 "return the result.")
993 route.reset()
994 continue
995 finally:
996 if isinstance(out, HTTPResponse):
997 out.apply(response)
998 try:
999 self.trigger_hook('after_request')
1000 except HTTPResponse as E:
1001 out = E
1002 out.apply(response)
1003 except (KeyboardInterrupt, SystemExit, MemoryError):
1004 raise
1005 except Exception as E:
1006 if not self.catchall: raise
1007 stacktrace = format_exc()
1008 environ['wsgi.errors'].write(stacktrace)
1009 environ['wsgi.errors'].flush()
1010 environ['bottle.exc_info'] = sys.exc_info()
1011 out = HTTPError(500, "Internal Server Error", E, stacktrace)
1012 out.apply(response)
1013
1014 return out
1015
1016 def _cast(self, out, peek=None):
1017 """ Try to convert the parameter into something WSGI compatible and set

Callers 1

wsgiMethod · 0.95

Calls 10

trigger_hookMethod · 0.95
deprFunction · 0.85
decodeMethod · 0.80
callMethod · 0.80
HTTPErrorClass · 0.70
matchMethod · 0.45
resetMethod · 0.45
applyMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected