Mercurial > hg
changeset 3359:41741218504d
hgweb: trap lookup errors
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Wed, 11 Oct 2006 16:56:41 -0700 |
parents | 818598f5bc8b |
children | ef8307585b41 |
files | mercurial/hgweb/hgweb_mod.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py Wed Oct 11 16:50:17 2006 -0700 +++ b/mercurial/hgweb/hgweb_mod.py Wed Oct 11 16:56:41 2006 -0700 @@ -13,7 +13,7 @@ demandload(globals(), "re zlib ConfigParser mimetools cStringIO sys tempfile") demandload(globals(), 'urllib') demandload(globals(), "mercurial:mdiff,ui,hg,util,archival,streamclone,patch") -demandload(globals(), "mercurial:templater") +demandload(globals(), "mercurial:revlog,templater") demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile,style_map") from mercurial.node import * from mercurial.i18n import gettext as _ @@ -765,7 +765,10 @@ method = getattr(self, 'do_' + cmd, None) if method: - method(req) + try: + method(req) + except (hg.RepoError, revlog.RevlogError), inst: + req.write(self.t("error", error=str(inst))) else: req.write(self.t("error", error='No such method: ' + cmd))