12 |
12 |
13 from rql import BadRQLQuery |
13 from rql import BadRQLQuery |
14 |
14 |
15 from cubicweb import set_log_methods |
15 from cubicweb import set_log_methods |
16 from cubicweb import (ValidationError, Unauthorized, AuthenticationError, |
16 from cubicweb import (ValidationError, Unauthorized, AuthenticationError, |
17 NoSelectableObject, RepositoryError) |
17 NoSelectableObject, RepositoryError) |
18 from cubicweb.cwvreg import CubicWebRegistry |
18 from cubicweb.cwvreg import CubicWebRegistry |
19 from cubicweb.web import (LOGGER, StatusResponse, DirectResponse, Redirect, NotFound, |
19 from cubicweb.web import (LOGGER, StatusResponse, DirectResponse, Redirect, |
20 RemoteCallFailed, ExplicitLogin, InvalidSession) |
20 NotFound, RemoteCallFailed, ExplicitLogin, |
|
21 InvalidSession, RequestError) |
21 from cubicweb.web.component import Component |
22 from cubicweb.web.component import Component |
22 |
23 |
23 # make session manager available through a global variable so the debug view can |
24 # make session manager available through a global variable so the debug view can |
24 # print information about web session |
25 # print information about web session |
25 SESSION_MANAGER = None |
26 SESSION_MANAGER = None |
346 raise |
347 raise |
347 except (AuthenticationError, NotFound, RemoteCallFailed): |
348 except (AuthenticationError, NotFound, RemoteCallFailed): |
348 raise |
349 raise |
349 except ValidationError, ex: |
350 except ValidationError, ex: |
350 self.validation_error_handler(req, ex) |
351 self.validation_error_handler(req, ex) |
351 except (Unauthorized, BadRQLQuery), ex: |
352 except (Unauthorized, BadRQLQuery, RequestError), ex: |
352 self.error_handler(req, ex, tb=False) |
353 self.error_handler(req, ex, tb=False) |
353 except Exception, ex: |
354 except Exception, ex: |
354 self.error_handler(req, ex, tb=True) |
355 self.error_handler(req, ex, tb=True) |
355 finally: |
356 finally: |
356 if req.cnx is not None: |
357 if req.cnx is not None: |