diff mercurial/hgweb.py @ 1554:68ec7b9e09a4

Catch IOErrors and RepoErrors when serving repositories via hgweb.
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 17 Nov 2005 19:38:57 +0100
parents d69070c2547a
children 59b3639df0a9
line wrap: on
line diff
--- 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: