panic on weird db action
Jes Olson j3s@c3f.net
Wed, 22 Mar 2023 17:17:38 -0700
2 files changed,
5 insertions(+),
3 deletions(-)
M
reaper/reaper.go
→
reaper/reaper.go
@@ -92,7 +92,7 @@ }
err := f.Update() if err != nil { fmt.Printf("[err] reaper: fetch failure url '%s' %s\n", f.UpdateURL, err) - err = r.db.SetFeedFetchError(f.UpdateURL, err.Error()) + r.db.SetFeedFetchError(f.UpdateURL, err.Error()) } }
M
sqlite/sql.go
→
sqlite/sql.go
@@ -209,9 +209,11 @@ }
// WriteFeed writes an rss feed to the database for permanent storage // if the given feed already exists, WriteFeed does nothing. -func (s *DB) SetFeedFetchError(url string, fetchErr string) error { +func (s *DB) SetFeedFetchError(url string, fetchErr string) { _, err := s.sql.Exec("UPDATE feed SET fetch_error=? WHERE url=?", fetchErr, url) - return err + if err != nil { + panic(err) + } } // WriteFeed writes an rss feed to the database for permanent storage