small pixel drawing of a pufferfish vore

panic on weird db action
Jes Olson j3s@c3f.net
Wed, 22 Mar 2023 17:17:38 -0700
commit

8081c19966a881a0fb6ed7eb38ccc12c3255ddf8

parent

cb2c8e9ec7e5b5a37667a3aa1ae9a0ce2a308fff

2 files changed, 5 insertions(+), 3 deletions(-)

jump to
M reaper/reaper.goreaper/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.gosqlite/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