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