print traceback even when handling exception
authorRyan Campbell <campbellr@gmail.com>
Thu, 6 May 2010 06:25:59 +0000 (00:25 -0600)
committerRyan Campbell <campbellr@gmail.com>
Thu, 6 May 2010 06:25:59 +0000 (00:25 -0600)
This should make debugging a bit simpler. A logger would still be nicer,
though

package/src/mevemon.py

index c4e2404..00ebe20 100755 (executable)
@@ -24,6 +24,7 @@ from eveapi import eveapi
 import fetchimg
 import apicache
 import os.path
+import traceback
 
 #conic is used for connection handling
 import conic
@@ -120,7 +121,8 @@ class mEveMon():
 
         try:
             auth = self.cached_api.auth(userID=uid, apiKey=api_key)
-        except: 
+        except:
+            traceback.print_exc()
             return None
 
         return auth
@@ -134,6 +136,7 @@ class mEveMon():
             sheet = self.get_auth(uid).character(char_id).CharacterSheet()
         except:
             # TODO: we should really have a logger that logs this error somewhere
+            traceback.print_exc()
             return None
 
         return sheet
@@ -170,6 +173,7 @@ class mEveMon():
             chars = self.cached_api.eve.CharacterName(ids=char_id).characters
             name = chars[0].characterName
         except:
+            traceback.print_exc()
             return None
 
         return name
@@ -186,6 +190,7 @@ class mEveMon():
             char_id = chars[0].characterID
             char_name = chars[0].name
         except:
+            traceback.print_exc()
             return None
 
         return char_id
@@ -202,6 +207,7 @@ class mEveMon():
                 api_char_list = auth.account.Characters()
                 char_list = [char.name for char in api_char_list.characters]
             except:
+                traceback.print_exc()
                 return None
 
         return char_list
@@ -252,6 +258,7 @@ class mEveMon():
         try:
             tree = self.cached_api.eve.SkillTree()
         except:
+            traceback.print_exc()
             return None
         
         return tree
@@ -265,6 +272,7 @@ class mEveMon():
         try:
             skill = self.get_auth(uid).character(char_id).SkillInTraining()
         except:
+            traceback.print_exc()
             return None
 
         return skill