summaryrefslogtreecommitdiff
path: root/dealconvert/formats/rzd.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-05-30 00:02:54 +0200
committeremkael <emkael@tlen.pl>2019-05-30 00:02:54 +0200
commitc417577b9cf19e00f92d583f3c82ff95c9e54efe (patch)
tree6511b4c4ae29926e1f3241fe6c19e2642d65d664 /dealconvert/formats/rzd.py
parent959305e4b73459cda5cde1de77f14a38457adeaa (diff)
Error reporting improved
Diffstat (limited to 'dealconvert/formats/rzd.py')
-rw-r--r--dealconvert/formats/rzd.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/dealconvert/formats/rzd.py b/dealconvert/formats/rzd.py
index 8ca1e97..93dbc45 100644
--- a/dealconvert/formats/rzd.py
+++ b/dealconvert/formats/rzd.py
@@ -51,11 +51,13 @@ class RZDFormat(DealFormat):
try:
idx = self.cards.index(card)
except ValueError:
- raise RuntimeError('invalid card: %s' % (card))
+ raise RuntimeError('invalid card: %s in board %d' % (card, deal.number))
values[idx*4+suit] = (i + offset)%4
for i in range(0, 13):
byte = 0
for j in range(0, 4):
+ if values[4*i+j] is None:
+ raise RuntimeError('missing card: %s%s in board %d' % ('SHDC'[j], self.cards[i], deal.number))
byte *= 4
byte += values[4*i+j]
value += chr(byte)