handle errors better here

This commit is contained in:
Christine Dodrill 2016-02-12 02:18:17 -08:00
parent 2e5c37a97c
commit 1dbe7f6f3d
1 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,9 @@ proc getTweetsFrom*(url: string, username: string): seq[Tweet] =
for line in body.splitLines().items():
if line.len > 0 and line[0] != '#':
res.add(username.parseTweet(line))
try:
res.add(username.parseTweet(line))
except: echo username & " " & getCurrentExceptionMsg()
return res
@ -68,4 +70,4 @@ proc updateTweetsByUser*(db: DBConn, username, url: string) {. gcsafe .} =
db.exec(sql"insert into tweets values(null, ?, ?, ?);", username, tweet.date.timeInfoToTime().toSeconds().int(), tweet.message)
except: discard
except:
echo getCurrentExceptionMsg()
echo username & " " & getCurrentExceptionMsg()