transport/init: print exception type if the execption has no string
There may be corner cases where an execption contains no error message.
In this case it might still be helpful to display the type of the
exeption calss to get at least an idea of what kind of error we are
dealing with.
Change-Id: I6e6b3acd17e40934050b9b088960a2f851120b26
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index dae2a78..72a80a9 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -234,5 +234,8 @@
sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate, **kwargs)
return sl
except Exception as e:
- print("Card reader initialization failed with exception:\n" + str(e))
+ if str(e):
+ print("Card reader initialization failed with exception:\n" + str(e))
+ else:
+ print("Card reader initialization failed with an exception of type:\n" + str(type(e)))
return None