##// END OF EJS Templates
init: better error reporting on failed components
marcink -
r988:67405995 python3
parent child Browse files
Show More
@@ -58,23 +58,30 b' from vcsserver.exceptions import HTTPRep'
58 58 from vcsserver.lib.exc_tracking import store_exception
59 59 from vcsserver.server import VcsServer
60 60
61
62 git_import_err = None
61 63 try:
62 64 from vcsserver.git import GitFactory, GitRemote
63 except ImportError:
65 except ImportError as e:
64 66 GitFactory = None
65 67 GitRemote = None
68 git_import_err = e
66 69
70 hg_import_err = None
67 71 try:
68 72 from vcsserver.hg import MercurialFactory, HgRemote
69 except ImportError:
73 except ImportError as e:
70 74 MercurialFactory = None
71 75 HgRemote = None
76 hg_import_err = e
72 77
78 svn_import_err = None
73 79 try:
74 80 from vcsserver.svn import SubversionFactory, SvnRemote
75 except ImportError:
81 except ImportError as e:
76 82 SubversionFactory = None
77 83 SvnRemote = None
84 svn_import_err = e
78 85
79 86
80 87 def _is_request_chunked(environ):
@@ -126,13 +133,13 b' class VCS(object):'
126 133 git_factory = GitFactory()
127 134 self._git_remote = GitRemote(git_factory)
128 135 else:
129 log.info("Git client import failed")
136 log.error("Git client import failed: %s", git_import_err)
130 137
131 138 if MercurialFactory and HgRemote:
132 139 hg_factory = MercurialFactory()
133 140 self._hg_remote = HgRemote(hg_factory)
134 141 else:
135 log.info("Mercurial client import failed")
142 log.error("Mercurial client import failed: %s", hg_import_err)
136 143
137 144 if SubversionFactory and SvnRemote:
138 145 svn_factory = SubversionFactory()
@@ -141,7 +148,7 b' class VCS(object):'
141 148 hg_factory = MercurialFactory()
142 149 self._svn_remote = SvnRemote(svn_factory, hg_factory=hg_factory)
143 150 else:
144 log.info("Subversion client import failed")
151 log.error("Subversion client import failed: %s", svn_import_err)
145 152
146 153 self._vcsserver = VcsServer()
147 154
@@ -149,8 +156,7 b' class VCS(object):'
149 156 if self.locale:
150 157 log.info('Settings locale: `LC_ALL` to %s', self.locale)
151 158 else:
152 log.info(
153 'Configuring locale subsystem based on environment variables')
159 log.info('Configuring locale subsystem based on environment variables')
154 160 try:
155 161 # If self.locale is the empty string, then the locale
156 162 # module will use the environment variables. See the
@@ -162,8 +168,7 b' class VCS(object):'
162 168 'Locale set to language code "%s" with encoding "%s".',
163 169 language_code, encoding)
164 170 except locale.Error:
165 log.exception(
166 'Cannot set locale, not configuring the locale system')
171 log.exception('Cannot set locale, not configuring the locale system')
167 172
168 173
169 174 class WsgiProxy(object):
General Comments 0
You need to be logged in to leave comments. Login now