hgweb: use ErrorResponse instead of custom response
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Tue, 22 Jan 2008 09:28:51 +0100
changeset 5925 c6274913eba5
parent 5924 b8009718a211
child 5926 15ef6b9c1f2f
hgweb: use ErrorResponse instead of custom response
mercurial/hgweb/webcommands.py
--- 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]