changeset 7740:176d3d681702

hgweb: pass ErrorResponses directly into req.respond()
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Mon, 09 Feb 2009 11:29:09 +0100
parents edcb56991afe
children a3d7f99c23c0
files mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Sat Feb 07 23:29:12 2009 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Mon Feb 09 11:29:09 2009 +0100
@@ -99,7 +99,7 @@
                 method = getattr(protocol, cmd)
                 return method(self.repo, req)
             except ErrorResponse, inst:
-                req.respond(inst.code, protocol.HGTYPE)
+                req.respond(inst, protocol.HGTYPE)
                 if not inst.message:
                     return []
                 return '0\n%s\n' % inst.message,
@@ -194,7 +194,7 @@
             req.respond(HTTP_SERVER_ERROR, ctype)
             return tmpl('error', error=str(inst))
         except ErrorResponse, inst:
-            req.respond(inst.code, ctype)
+            req.respond(inst, ctype)
             return tmpl('error', error=inst.message)
 
     def templater(self, req):
--- a/mercurial/hgweb/hgwebdir_mod.py	Sat Feb 07 23:29:12 2009 +0100
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon Feb 09 11:29:09 2009 +0100
@@ -168,7 +168,7 @@
                 return tmpl("notfound", repo=virtual)
 
             except ErrorResponse, err:
-                req.respond(err.code, ctype)
+                req.respond(err, ctype)
                 return tmpl('error', error=err.message or '')
         finally:
             tmpl = None