# HG changeset patch # User Thomas Arendsen Hein # Date 1132252737 -3600 # Node ID 68ec7b9e09a48d8100cf5394279060cefdda1f82 # Parent 4aeba581990bf84dd5287c62a959e7b5657535e1 Catch IOErrors and RepoErrors when serving repositories via hgweb. diff -r 4aeba581990b -r 68ec7b9e09a4 mercurial/hgweb.py --- a/mercurial/hgweb.py Thu Nov 17 19:18:33 2005 +0100 +++ b/mercurial/hgweb.py Thu Nov 17 19:38:57 2005 +0100 @@ -1013,7 +1013,12 @@ if virtual: real = dict(self.repos).get(virtual) if real: - hgweb(real).run(req) + try: + hgweb(real).run(req) + except IOError, inst: + req.write(tmpl("error", error=inst.strerror)) + except hg.RepoError, inst: + req.write(tmpl("error", error=str(inst))) else: req.write(tmpl("notfound", repo=virtual)) else: diff -r 4aeba581990b -r 68ec7b9e09a4 templates/error.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/error.tmpl Thu Nov 17 19:38:57 2005 +0100 @@ -0,0 +1,15 @@ +#header# +Mercurial Error + + + +

Mercurial Error

+ +

+An error occured while processing your request: +

+

+#error|escape# +

+ +#footer# diff -r 4aeba581990b -r 68ec7b9e09a4 templates/map --- a/templates/map Thu Nov 17 19:18:33 2005 +0100 +++ b/templates/map Thu Nov 17 19:38:57 2005 +0100 @@ -39,3 +39,4 @@ index = index.tmpl archiveentry = "#type# " notfound = notfound.tmpl +error = error.tmpl