xid failure should just panic

This commit is contained in:
Ted Unangst 2019-04-15 18:01:30 -04:00
parent a1b5912b95
commit fd632ab1d4
2 changed files with 3 additions and 8 deletions

8
fun.go
View File

@ -88,17 +88,15 @@ func xfiltrate() string {
continue continue
} }
if err != sql.ErrNoRows { if err != sql.ErrNoRows {
log.Printf("err picking xid: %s", err) log.Panicf("err picking xid: %s", err)
return ""
} }
r = db.QueryRow("select fileid from files where name = ?", s) r = db.QueryRow("select fileid from files where xid = ?", s)
err = r.Scan(&x) err = r.Scan(&x)
if err == nil { if err == nil {
continue continue
} }
if err != sql.ErrNoRows { if err != sql.ErrNoRows {
log.Printf("err picking xid: %s", err) log.Panicf("err picking xid: %s", err)
return ""
} }
return s return s
} }

View File

@ -703,9 +703,6 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
dt := time.Now().UTC() dt := time.Now().UTC()
xid := xfiltrate() xid := xfiltrate()
if xid == "" {
return
}
what := "honk" what := "honk"
if rid != "" { if rid != "" {
what = "tonk" what = "tonk"