changeset 111:8d76fd3918a5

Don't just bail on the build configuration page if an invalid repository path is configured.
author cmlenz
date Thu, 04 Aug 2005 13:21:08 +0000
parents c58c74e7df16
children a38eabd4b6e1
files bitten/trac_ext/web_ui.py
diffstat 1 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/trac_ext/web_ui.py
+++ b/bitten/trac_ext/web_ui.py
@@ -318,17 +318,20 @@
         ]
 
         repos = self.env.get_repository(req.authname)
-        root = repos.get_node(config.path)
-        num = 0
-        for idx, (path, rev, chg) in enumerate(root.get_history()):
-            prefix = 'build.builds.%d' % rev
-            req.hdf[prefix + '.href'] = self.env.href.changeset(rev)
-            for build in Build.select(self.env, config=config.name, rev=rev):
-                if build.status == Build.PENDING:
-                    continue
-                req.hdf['%s.%s' % (prefix, build.platform)] = self._build_to_hdf(build)
-            if idx > 4:
-                break
+        try:
+            root = repos.get_node(config.path)
+            num = 0
+            for idx, (path, rev, chg) in enumerate(root.get_history()):
+                prefix = 'build.builds.%d' % rev
+                req.hdf[prefix + '.href'] = self.env.href.changeset(rev)
+                for build in Build.select(self.env, config=config.name, rev=rev):
+                    if build.status == Build.PENDING:
+                        continue
+                    req.hdf['%s.%s' % (prefix, build.platform)] = self._build_to_hdf(build)
+                if idx > 4:
+                    break
+        except TracError, e:
+            self.log.error('Error accessing repository info', exc_info=True)
 
     def _render_config_form(self, req, config_name=None):
         config = BuildConfig.fetch(self.env, config_name)
Copyright (C) 2012-2017 Edgewall Software