def handle(self, environ, start_response, url_map, match, request_id,
request_type):
"""Serves a request by displaying an error page.
Args:
environ: An environ dict for the request as defined in PEP-333.
start_response: A function with semantics defined in PEP-333.
url_map: An appinfo.URLMap instance containing the configuration for the
handler matching this request.
match: A re.MatchObject containing the result of the matched URL pattern.
request_id: A unique string id associated with the request.
request_type: The type of the request. See instance.*_REQUEST module
constants.
Yields:
A sequence of strings containing the body of the HTTP response.
"""
start_response('500 Internal Server Error',
[('Content-Type', 'text/html')])
yield '<html><head><title>Invalid PHP Configuration</title></head>'
yield '<body>'
yield '<title>Invalid PHP Configuration</title>'
if isinstance(self._exception, _PHPEnvironmentError):
yield '<b>The PHP interpreter specified with the --php_executable_path '
yield ' flag ("%s") is not compatible with the App Engine ' % (
self._php_executable_path)
yield 'PHP development environment.</b><br>'
yield '<br>'
yield '<pre>%s</pre>' % self._exception
else:
yield '<b>%s</b>' % cgi.escape(str(self._exception))
yield '</body></html>'
评论列表
文章目录