From 30ae9da2df56d9bdc750d441688727917ba76312 Mon Sep 17 00:00:00 2001 From: grindi Date: Thu, 6 Aug 2009 19:15:55 +0400 Subject: [PATCH] Fixed hung up on incorrect hand history --- pyfpdb/HandHistoryConverter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index bb30e705..6d653509 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -96,7 +96,10 @@ Otherwise, finish at eof. handsList = self.allHandsAsList() logging.info("Parsing %d hands" % len(handsList)) for handText in handsList: - self.processedHands.append(self.processHand(handText)) + try: + self.processedHands.append(self.processHand(handText)) + except Exception, e: # TODO: it's better to write something like HhcEception here + logging.error("Caught exception while parsing hand: %s" % str(e)) numHands= len(handsList) endtime = time.time() print "read %d hands in %.3f seconds" % (numHands, endtime - starttime)