diff --git a/lib/jnpr/junos/exception.py b/lib/jnpr/junos/exception.py
index 6e3a89fa..390dc34e 100644
--- a/lib/jnpr/junos/exception.py
+++ b/lib/jnpr/junos/exception.py
@@ -1,4 +1,3 @@
-from lxml import etree
 from jnpr.junos import jxml
 
 
@@ -129,6 +128,9 @@ class ConnectError(Exception):
     """
     Parent class for all connection related exceptions
     """
+    def __init__(self, dev, msg=None):
+        self.dev = dev
+        self._orig = msg
 
     @property
     def user(self):
@@ -145,15 +147,18 @@ class ConnectError(Exception):
         """ login SSH port """
         return self.dev._port
 
-    def __init__(self, dev):
-        self.dev = dev
-        # @@@ need to attach attributes for each access
-        # @@@ to user-name, host, jump-host, etc.
+    @property
+    def msg(self):
+        """ login SSH port """
+        return self._orig
 
     def __repr__(self):
-        return "{0}({1})".format(
-            self.__class__.__name__,
-            self.dev.hostname)
+        if self._orig:
+            return "{0}(host: {1}, msg: {2})".format(self.__class__.__name__,
+                                                     self.dev.hostname, self._orig)
+        else:
+            return "{0}({1})".format(self.__class__.__name__,
+                                     self.dev.hostname)
 
     __str__ = __repr__
 

Invalid host key error not caught
If the `~.ssh/known_hosts` file contains an invalid entry (in my case, caused by a missing newline) then PyEZ will only return the nondescript `ConnectError` message.

The failure comes from the **ncclient** `manager.connect()` function which, in turn, calls **paramiko**'s `load_known_hosts()`. The latter actually returns a clear error message:

```
InvalidHostKey: ('172.22.196.114 ssh-rsa AAAA...
    <snip />
    ...+SQ==', Error('Incorrect padding',))
```

I think there are 2 issues here:

1. **ncclient** `manager.connect()` takes several arguments, one of which is `hostkey_verify` which we set to `False` so I believe we should not even be loading the `known_hosts` file. I played with different parameters and we always seem to be performing this verification - this is a ncclient bug in my opinion.

2. PyEZ obfuscates the error by using the generic ConnectError message - this occurs in the following bit of code in the `device.py` file:

```python
        except Exception as err:
            # anything else, we will re-raise as a
            # generic ConnectError
            cnx_err = EzErrors.ConnectError(self)
            cnx_err._orig = err
            raise cnx_err
```
If we were to `raise cnx_err._orig` instead then we would have a clearer picture of what's going on.
diff --git a/tests/unit/test_exception.py b/tests/unit/test_exception.py
index bf340cd9..99821e75 100644
--- a/tests/unit/test_exception.py
+++ b/tests/unit/test_exception.py
@@ -61,14 +61,19 @@ class Test_RpcError(unittest.TestCase):
         self.assertEqual(obj.rpc_error['bad_element'], 'unit 2')
 
     def test_ConnectError(self):
-        self.dev = Device(host='1.1.1.1', user='rick', password='password123',
-                          gather_facts=False)
+        self.dev = Device(host='1.1.1.1', user='rick')
         obj = ConnectError(self.dev)
         self.assertEqual(obj.user, 'rick')
         self.assertEqual(obj.host, '1.1.1.1')
         self.assertEqual(obj.port, 830)
         self.assertEqual(repr(obj), 'ConnectError(1.1.1.1)')
 
+    def test_ConnectError_msg(self):
+        self.dev = Device(host='1.1.1.1', user='rick')
+        obj = ConnectError(self.dev, msg='underlying exception info')
+        self.assertEqual(obj.msg, 'underlying exception info')
+        self.assertEqual(repr(obj), 'ConnectError(host: 1.1.1.1, msg: underlying exception info)')
+
     def test_CommitError_repr(self):
         rsp = etree.XML(commit_xml)
         obj = CommitError(rsp=rsp)

pip install -e .[dev]
parse_log_pytest
requirements.txt
coverage mock nose pep8 pyflakes coveralls ntc_templates cryptography==3.2 pytest
apt-get update apt-get install -y gcc
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
bcrypt==4.2.1
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
coverage==6.5.0
coveralls==3.3.1
cryptography==44.0.2
docopt==0.6.2
exceptiongroup==1.2.2
future==1.0.0
idna==3.10
importlib-metadata==6.7.0
iniconfig==2.0.0
Jinja2==3.1.6
-e git+https://github.com/Juniper/py-junos-eznc.git@c561ed6f7e16b63a2d71c410c1ce2acc4fa75ed8#egg=junos_eznc
lxml==5.3.1
MarkupSafe==2.1.5
mock==5.2.0
ncclient==0.6.19
netaddr==1.3.0
nose==1.3.7
ntc_templates==4.0.1
packaging==24.0
paramiko==3.5.1
pep8==1.7.1
pluggy==1.2.0
pycparser==2.21
pyflakes==3.0.1
PyNaCl==1.5.0
pytest==7.4.4
PyYAML==6.0.1
requests==2.31.0
scp==0.15.0
six==1.17.0
textfsm==1.1.3
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
zipp==3.15.0

name: py-junos-eznc
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - bcrypt==4.2.1
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - coverage==6.5.0
      - coveralls==3.3.1
      - cryptography==44.0.2
      - docopt==0.6.2
      - exceptiongroup==1.2.2
      - future==1.0.0
      - idna==3.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - lxml==5.3.1
      - markupsafe==2.1.5
      - mock==5.2.0
      - ncclient==0.6.19
      - netaddr==1.3.0
      - nose==1.3.7
      - ntc-templates==4.0.1
      - packaging==24.0
      - paramiko==3.5.1
      - pep8==1.7.1
      - pluggy==1.2.0
      - pycparser==2.21
      - pyflakes==3.0.1
      - pynacl==1.5.0
      - pytest==7.4.4
      - pyyaml==6.0.1
      - requests==2.31.0
      - scp==0.15.0
      - six==1.17.0
      - textfsm==1.1.3
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - zipp==3.15.0
prefix: /opt/conda/envs/py-junos-eznc

tests/unit/test_exception.py::Test_RpcError::test_ConnectError_msg
tests/unit/test_exception.py::Test_RpcError::test_CommitError_repr tests/unit/test_exception.py::Test_RpcError::test_ConfigLoadError_repr tests/unit/test_exception.py::Test_RpcError::test_ConnectError tests/unit/test_exception.py::Test_RpcError::test_RpcTimeoutError_repr tests/unit/test_exception.py::Test_RpcError::test_rpcerror_jxml_check tests/unit/test_exception.py::Test_RpcError::test_rpcerror_repr
lib/jnpr/junos/exception.py
lib/jnpr/junos/exception.py