From dbaf4dbdbc639d9fe3ee225e60b69b5e80190ec5 Mon Sep 17 00:00:00 2001 From: grindi Date: Sat, 7 Nov 2009 21:57:23 +0300 Subject: [PATCH] Make msgs about parse errors more verbose + fix small bug in FpdbParseError --- pyfpdb/Exceptions.py | 4 ++-- pyfpdb/HandHistoryConverter.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Exceptions.py b/pyfpdb/Exceptions.py index eaf5d798..f7e9fa54 100644 --- a/pyfpdb/Exceptions.py +++ b/pyfpdb/Exceptions.py @@ -9,8 +9,8 @@ class FpdbParseError(FpdbError): self.value = value self.hid = hid def __str__(self): - if hid: - return repr("HID:"+hid+", "+self.value) + if self.hid: + return repr("HID:"+self.hid+", "+self.value) else: return repr(self.value) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 53358d36..6452cae4 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -154,6 +154,7 @@ Otherwise, finish at EOF. except FpdbParseError, e: numErrors += 1 log.warning("Failed to convert hand %s" % e.hid) + log.warning("Exception msg: '%s'" % str(e)) log.debug(handText) else: handsList = self.allHandsAsList() @@ -168,6 +169,7 @@ Otherwise, finish at EOF. except FpdbParseError, e: numErrors += 1 log.warning("Failed to convert hand %s" % e.hid) + log.warning("Exception msg: '%s'" % str(e)) log.debug(handText) numHands = len(handsList) endtime = time.time()