if something bad happens, don't just show blank page
Ted Unangst tedu@tedunangst.com
Mon, 01 Jul 2019 19:31:14 -0400
1 files changed,
2 insertions(+),
0 deletions(-)
jump to
M
honk.go
→
honk.go
@@ -1072,6 +1072,7 @@ res, err := stmtSaveHonk.Exec(userinfo.UserID, what, honk.Honker, xid, rid,
dt.Format(dbtimeformat), "", aud, honk.Noise, convoy, whofore, "html", honk.Precis, honk.Oonker) if err != nil { log.Printf("error saving honk: %s", err) + http.Error(w, "something bad happened while saving", http.StatusInternalServerError) return } honk.ID, _ = res.LastInsertId()@@ -1079,6 +1080,7 @@ for _, d := range honk.Donks {
_, err = stmtSaveDonk.Exec(honk.ID, d.FileID) if err != nil { log.Printf("err saving donk: %s", err) + http.Error(w, "something bad happened while saving", http.StatusInternalServerError) return } }