[dbapi] Stop shadowing exceptions in get_repository() (closes #2710515)
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 11 Feb 2013 11:26:08 +0100
changeset 8702 d47089677d44
parent 8701 d94d3a3ba586
child 8703 db3164d09765
[dbapi] Stop shadowing exceptions in get_repository() (closes #2710515) Exceptions are already handled higher up in the stack so there's no reason to handle them here. Furthermore, non-ConnectionError exceptions would get hidden, making debugging harder.
dbapi.py
--- a/dbapi.py	Mon Feb 25 11:18:14 2013 +0100
+++ b/dbapi.py	Mon Feb 11 11:26:08 2013 +0100
@@ -103,15 +103,6 @@
     The returned repository may be an in-memory repository or a proxy object
     using a specific RPC method, depending on the given URI (pyro or zmq).
     """
-    try:
-        return _get_repository(uri, config, vreg)
-    except ConnectionError:
-        raise
-    except Exception as exc:
-        raise ConnectionError('cause: %r' % exc)
-
-def _get_repository(uri=None, config=None, vreg=None):
-    """ implements get_repository (see above) """
     if uri is None:
         return _get_inmemory_repo(config, vreg)