fixeria has uploaded this change for review.

View Change

transport/pcsc: throw ReaderError with a message

Before this patch:

$ ./pySim-shell.py -p 0
Card reader initialization failed with an exception of type:
<class 'pySim.exceptions.ReaderError'>

after:

$ ./pySim-shell.py -p 0
Card reader initialization failed with exception:
No reader found with number 0

Change-Id: Id08c4990857f7083a8d1cefc90ff85fc20ab6fef
---
M pySim/transport/pcsc.py
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/82/27882/1
diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index ca1751a..0f87b18 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -34,7 +34,7 @@
super().__init__(**kwargs)
r = readers()
if reader_number >= len(r):
- raise ReaderError
+ raise ReaderError('No reader found with number %d' % reader_number)
self._reader = r[reader_number]
self._con = self._reader.createConnection()


To view, visit change 27882. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id08c4990857f7083a8d1cefc90ff85fc20ab6fef
Gerrit-Change-Number: 27882
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange