Changeset - 244c9b103cff
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2015-01-06 00:54:36
madski@unity3d.com
error: be prepared for resp without status

I have seen traces that shows that it can happen. Be prepared!
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/error.py
Show inline comments
 
@@ -57,15 +57,15 @@ class ErrorController(BaseController):
 
        resp = request.environ.get('pylons.original_response')
 
        c.site_name = config.get('title')
 

	
 
        log.debug('### %s ###' % resp.status)
 
        log.debug('### %s ###' % resp and resp.status)
 

	
 
        e = request.environ
 
        c.serv_p = r'%(protocol)s://%(host)s/' \
 
                                    % {'protocol': e.get('wsgi.url_scheme'),
 
                                       'host': e.get('HTTP_HOST'), }
 

	
 
        c.error_message = cgi.escape(request.GET.get('code', str(resp.status)))
 
        c.error_explanation = self.get_error_explanation(resp.status_int)
 
        c.error_message = resp and cgi.escape(request.GET.get('code', str(resp.status)))
 
        c.error_explanation = resp and self.get_error_explanation(resp.status_int)
 

	
 
        return render('/errors/error_document.html')
 

	
0 comments (0 inline, 0 general)