OSDN Git Service
(root)
/
gwit
/
gwit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd6c840
)
Added exception handling
author
Hirotaka Kawata
<hktechno@hotmail.com>
Wed, 17 Feb 2010 16:49:07 +0000
(
01:49
+0900)
committer
Hirotaka Kawata
<hktechno@hotmail.com>
Wed, 17 Feb 2010 16:49:07 +0000
(
01:49
+0900)
twitterapi.py
patch
|
blob
|
history
diff --git
a/twitterapi.py
b/twitterapi.py
index
4a859ae
..
2a58306
100644
(file)
--- a/
twitterapi.py
+++ b/
twitterapi.py
@@
-4,6
+4,7
@@
import twoauth
import threading
import time
+import sys
# Twitter API Class
class twitterapi():
@@
-39,8
+40,12
@@
class timeline_thread(threading.Thread):
# Thread run
def run(self):
while True:
- # Get Timeline
- self.last = self.func(*self.args, **self.kwargs)
+ try:
+ # Get Timeline
+ self.last = self.func(*self.args, **self.kwargs)
+ except Exception, e:
+ self.last = list()
+ print >>sys.stderr, "Error", e
# If Timeline update
if self.last: