diff --git a/pySim/exceptions.py b/pySim/exceptions.py index 24aff854..c6a81a13 100644 --- a/pySim/exceptions.py +++ b/pySim/exceptions.py @@ -53,8 +53,8 @@ class SwMatchError(Exception): self.rs = rs def __str__(self): - if self.rs: - r = self.rs.interpret_sw(self.sw_actual) + if self.rs and self.rs.lchan[0]: + r = self.rs.lchan[0].interpret_sw(self.sw_actual) if r: return "SW match failed! Expected %s and got %s: %s - %s" % (self.sw_expected, self.sw_actual, r[0], r[1]) return "SW match failed! Expected %s and got %s." % (self.sw_expected, self.sw_actual)