From 87f1cfe1b1d2796ae32ad1909004e1c20714493f Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 7 Feb 2016 18:51:41 -0800 Subject: [PATCH] fix a bug in time parsing --- src/time/gotime.nim | 6 +++++- src/time/time.go | 4 +--- src/twtxt.nim | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/time/gotime.nim b/src/time/gotime.nim index bf22a25..66fc107 100644 --- a/src/time/gotime.nim +++ b/src/time/gotime.nim @@ -10,7 +10,11 @@ proc parseTime*(inp: string): TimeInfo = if res == nil: raise newException(ValueError, "Invalid time passed to this thing") - return res[].fromSeconds.timeToTimeInfo + let + resdep = res[] + restime = resdep.fromSeconds + + return restime.timeToTimeInfo when isMainModule: let myTime = fixTime("2006-01-02T15:04:05.000000-07:00") diff --git a/src/time/time.go b/src/time/time.go index 6869f03..4df3a4c 100644 --- a/src/time/time.go +++ b/src/time/time.go @@ -1,8 +1,6 @@ package main -import ( - "time" -) +import "time" import "C" diff --git a/src/twtxt.nim b/src/twtxt.nim index 87ad532..a16fd35 100644 --- a/src/twtxt.nim +++ b/src/twtxt.nim @@ -74,5 +74,7 @@ proc updateTweetsOnce*() {. gcsafe .} = for tweet in tweets.items(): try: db.exec(sql"insert into tweets values(null, ?, ?, ?);", username, tweet.date.timeInfoToTime().toSeconds().int(), tweet.message) - except: discard - except: discard + except: + echo getCurrentExceptionMsg() + except: + echo getCurrentExceptionMsg()