changeset 5925:c6274913eba5

hgweb: use ErrorResponse instead of custom response
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 22 Jan 2008 09:28:51 +0100
parents b8009718a211
children 15ef6b9c1f2f
files mercurial/hgweb/webcommands.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Tue Jan 22 09:11:11 2008 +0100
+++ b/mercurial/hgweb/webcommands.py	Tue Jan 22 09:28:51 2008 +0100
@@ -7,7 +7,7 @@
 
 import os, mimetypes
 from mercurial import revlog, util
-from common import staticfile
+from common import staticfile, ErrorResponse
 
 def log(web, req, tmpl):
     if 'file' in req.form and req.form['file'][0]:
@@ -100,8 +100,7 @@
         web.archive(tmpl, req, req.form['node'][0], type_)
         return
 
-    req.respond(400, tmpl('error',
-                           error='Unsupported archive type: %s' % type_))
+    raise ErrorResponse(400, 'Unsupported archive type: %s' % type_)
 
 def static(web, req, tmpl):
     fname = req.form['file'][0]