Change in pysim[master]: filsystem: Make NotImplementedError more verbose.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Oct 14 15:44:30 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/25789 )

Change subject: filsystem: Make NotImplementedError more verbose.
......................................................................

filsystem: Make NotImplementedError more verbose.

Before:
EXCEPTION of type 'NotImplementedError' occurred with message: ''

After:
EXCEPTION of type 'NotImplementedError' occurred with message: 'EF(EF.SST) encoder not yet implemented. Patches welcome.'

Change-Id: Ie8a10a8847f7c7c6a3332fb9f78de18c9f7f41d0
---
M pySim/filesystem.py
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 5cdac56..8edac41 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -551,7 +551,7 @@
         elif self._tlv:
             self._tlv.from_dict(abstract_data)
             return self._tlv.to_tlv()
-        raise NotImplementedError
+        raise NotImplementedError("%s encoder not yet implemented. Patches welcome." % self)
 
     def encode_hex(self, abstract_data:dict) -> str:
         """Encode abstract representation into raw (hex string) data.
@@ -577,7 +577,7 @@
         elif self._tlv:
             self._tlv.from_dict(abstract_data)
             return b2h(self._tlv.to_tlv())
-        raise NotImplementedError
+        raise NotImplementedError("%s encoder not yet implemented. Patches welcome." % self)
 
 
 class LinFixedEF(CardEF):
@@ -787,7 +787,7 @@
         elif self._tlv:
             self._tlv.from_dict(abstract_data)
             return b2h(self._tlv.to_tlv())
-        raise NotImplementedError
+        raise NotImplementedError("%s encoder not yet implemented. Patches welcome." % self)
 
     def encode_record_bin(self, abstract_data:dict) -> bytearray:
         """Encode abstract representation into raw (binary) data.
@@ -812,7 +812,7 @@
         elif self._tlv:
             self._tlv.from_dict(abstract_data)
             return self._tlv.to_tlv()
-        raise NotImplementedError
+        raise NotImplementedError("%s encoder not yet implemented. Patches welcome." % self)
 
 class CyclicEF(LinFixedEF):
     """Cyclic EF (Entry File) in the smart card filesystem"""
@@ -920,7 +920,7 @@
         elif self._tlv:
             self._tlv.from_dict(abstract_data)
             return b2h(self._tlv.to_tlv())
-        raise NotImplementedError
+        raise NotImplementedError("%s encoder not yet implemented. Patches welcome." % self)
 
     def encode_record_bin(self, abstract_data:dict) -> bytearray:
         """Encode abstract representation into raw (binary) data.
@@ -945,7 +945,7 @@
         elif self._tlv:
             self._tlv.from_dict(abstract_data)
             return self._tlv.to_tlv()
-        raise NotImplementedError
+        raise NotImplementedError("%s encoder not yet implemented. Patches welcome." % self)
 
     def _decode_bin(self, raw_bin_data:bytearray):
         chunks = [raw_bin_data[i:i+self.rec_len] for i in range(0, len(raw_bin_data), self.rec_len)]

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/25789
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ie8a10a8847f7c7c6a3332fb9f78de18c9f7f41d0
Gerrit-Change-Number: 25789
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211014/efa4af99/attachment.htm>


More information about the gerrit-log mailing list