From bc59e1276896cb6b4af740f93baef9edabcd41de Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 10 Dec 2010 17:53:59 +0800 Subject: [PATCH] Everleaf: Make re_GameInfo error handling consistant with other sites. When re_GameInfo fails to match now, the first 100 characters of the hand will be printed to the log. Makes it much easier to identify the offending hands. Error now also throws an FpdbParseError for the importing process to catch --- pyfpdb/EverleafToFpdb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyfpdb/EverleafToFpdb.py b/pyfpdb/EverleafToFpdb.py index 586d36d9..fced271a 100755 --- a/pyfpdb/EverleafToFpdb.py +++ b/pyfpdb/EverleafToFpdb.py @@ -106,7 +106,10 @@ or None if we fail to get the info """ m = self.re_GameInfo.search(handText) if not m: - return None + tmp = handText[0:100] + log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp) + log.error(_("determineGameType: Raising FpdbParseError")) + raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp) mg = m.groupdict()