Mercurial > piecrust2
comparison piecrust/serving/server.py @ 449:30f2c2a595f5
serve: Use Werkzeug's HTTP exceptions correctly.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 06 Jul 2015 21:27:26 -0700 |
parents | d5724c0c8f1a |
children | 64e1cd71b30b |
comparison
equal
deleted
inserted
replaced
448:a17774094db8 | 449:30f2c2a595f5 |
---|---|
94 def _run_request(self, environ, start_response): | 94 def _run_request(self, environ, start_response): |
95 try: | 95 try: |
96 return self._try_run_request(environ, start_response) | 96 return self._try_run_request(environ, start_response) |
97 except Exception as ex: | 97 except Exception as ex: |
98 if self.debug: | 98 if self.debug: |
99 if isinstance(ex, HTTPException): | |
100 return ex | |
99 raise | 101 raise |
100 return self._handle_error(ex, environ, start_response) | 102 return self._handle_error(ex, environ, start_response) |
101 | 103 |
102 def _try_run_request(self, environ, start_response): | 104 def _try_run_request(self, environ, start_response): |
103 request = Request(environ) | 105 request = Request(environ) |