Hi,

Today I stumbled upon the following error message:
because I was missing a <stats> node in poker.server.xml

Feel free to review and apply the following patch that I believe add a
better error message.

Hope that helps.
-- 
Johan Euphrosine <[email protected]>
Index: pokernetwork/attrpack.py
===================================================================
--- pokernetwork/attrpack.py	(revision 5707)
+++ pokernetwork/attrpack.py	(working copy)
@@ -87,7 +87,7 @@
         try:
             return getattr(__import__(self.moduleStr, globals(), locals(), [classname]), classname)
         except AttributeError, ae:
-            self.error(ae.__str__())
+            self.error(ae.__str__() + ", falling back on %s" % self.defaultClass)
         classname = self.defaultClass
         return getattr(__import__(self.moduleStr, globals(), locals(), [classname]), classname)
 ############################################################################
Index: tests/test-userstats.py.in
===================================================================
--- tests/test-userstats.py.in	(revision 5707)
+++ tests/test-userstats.py.in	(working copy)
@@ -101,7 +101,7 @@
 
         clear_all_messages()
         self.assertEquals(f.getClass("DOESNOTEXIST"), UserStatsEmptyLookup)
-        self.assertEquals(get_messages(), ["ERROR 'module' object has no attribute 'UserStatsDOESNOTEXISTLookup'"])
+        self.assertEquals(get_messages(), ["ERROR 'module' object has no attribute 'UserStatsDOESNOTEXISTLookup', falling back on UserStatsEmptyLookup"])
 
         self.assertEquals(f.getClass("RankPercentile"), UserStatsRankPercentileLookup)
     # -------------------------------------------------------------------------
_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users

Reply via email to