Terrible, horrible exception handling. Terrible. Seriously. Can't be bothered to improve it.
This commit is contained in:
parent
a5fc8d5d6b
commit
4baabc3017
2 changed files with 8 additions and 2 deletions
|
@ -40,11 +40,14 @@ while True:
|
||||||
cur.execute("DELETE FROM tweets WHERE sender = %s;" % sender)
|
cur.execute("DELETE FROM tweets WHERE sender = %s;" % sender)
|
||||||
sql_conn.commit()
|
sql_conn.commit()
|
||||||
continue
|
continue
|
||||||
except:
|
except Exception, e:
|
||||||
|
print "Error in " + str(twid)
|
||||||
|
print e
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
date = dateutil.parser.parse(text,dayfirst=True,fuzzy=True)
|
date = dateutil.parser.parse(text,dayfirst=True,fuzzy=True)
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
|
print "Error in " + str(twid)
|
||||||
print e
|
print e
|
||||||
try:
|
try:
|
||||||
api.update_status("@%s Sorry, ich verstehe deinen Tweet nicht... :(" % sender, twid)
|
api.update_status("@%s Sorry, ich verstehe deinen Tweet nicht... :(" % sender, twid)
|
||||||
|
@ -62,6 +65,7 @@ while True:
|
||||||
try:
|
try:
|
||||||
api.update_status("@%s Das war doch schon...?" % sender, twid)
|
api.update_status("@%s Das war doch schon...?" % sender, twid)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
print "Error in " + str(twid)
|
||||||
print e
|
print e
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,9 @@ while True:
|
||||||
api.update_status("@%s %s" % (recipient, text), original)
|
api.update_status("@%s %s" % (recipient, text), original)
|
||||||
cur.execute("UPDATE tweets SET sent = 1 WHERE tweet_id = %i" % original)
|
cur.execute("UPDATE tweets SET sent = 1 WHERE tweet_id = %i" % original)
|
||||||
sql_conn.commit()
|
sql_conn.commit()
|
||||||
except:
|
except Exception, e:
|
||||||
|
print "Error in " + str(twid)
|
||||||
|
print e
|
||||||
pass
|
pass
|
||||||
|
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
Loading…
Reference in a new issue