diff options
author | ianb <devnull@localhost> | 2006-04-24 01:01:21 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-04-24 01:01:21 +0000 |
commit | 716647d2cc92a0a6ec1b13946df1d45df584289a (patch) | |
tree | f12cf813ede5e3ac42369fee316173bdf069acfd /paste/evalexception | |
parent | 6efa58a10630ed751d39d4f96ce06152cd5ecfb7 (diff) | |
download | paste-716647d2cc92a0a6ec1b13946df1d45df584289a.tar.gz |
When xmlhttp was detected, we weren't saving the debug info, so you couldn't view the full traceback; also the error wasn't very good when a key was missing
Diffstat (limited to 'paste/evalexception')
-rw-r--r-- | paste/evalexception/middleware.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py index 302a84a..31e569c 100644 --- a/paste/evalexception/middleware.py +++ b/paste/evalexception/middleware.py @@ -198,7 +198,15 @@ class EvalException(object): mochikit.exposed = True def view(self, environ, start_response): - id = int(wsgilib.path_info_pop(environ)) + id = int(request.path_info_pop(environ)) + if id not in self.debug_infos: + start_response( + '500 Server Error', + [('Content-type', 'text/html')]) + return [ + "Traceback by id %s does not exist (maybe " + "the server has been restarted?)" + % id] debug_info = self.debug_infos[id] return debug_info.wsgi_application(environ, start_response) view.exposed = True @@ -277,6 +285,12 @@ class EvalException(object): exc_info) environ['wsgi.errors'].write('Debug at: %s\n' % view_uri) + exc_data = collector.collect_exception(*exc_info) + debug_info = DebugInfo(count, exc_info, exc_data, base_path, + environ) + assert count not in self.debug_infos + self.debug_infos[count] = debug_info + if self.xmlhttp_key: get_vars = wsgilib.parse_querystring(environ) if dict(get_vars).get(self.xmlhttp_key): @@ -286,11 +300,6 @@ class EvalException(object): include_reusable=False, show_extra_data=False) return [html] - exc_data = collector.collect_exception(*exc_info) - debug_info = DebugInfo(count, exc_info, exc_data, base_path, - environ) - assert count not in self.debug_infos - self.debug_infos[count] = debug_info # @@: it would be nice to deal with bad content types here return debug_info.content() |