if something bad happens, don't just show blank page
This commit is contained in:
parent
6aaa0fe5cb
commit
8935b8a01c
2
honk.go
2
honk.go
|
@ -1072,6 +1072,7 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
dt.Format(dbtimeformat), "", aud, honk.Noise, convoy, whofore, "html", honk.Precis, honk.Oonker)
|
dt.Format(dbtimeformat), "", aud, honk.Noise, convoy, whofore, "html", honk.Precis, honk.Oonker)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error saving honk: %s", err)
|
log.Printf("error saving honk: %s", err)
|
||||||
|
http.Error(w, "something bad happened while saving", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
honk.ID, _ = res.LastInsertId()
|
honk.ID, _ = res.LastInsertId()
|
||||||
|
@ -1079,6 +1080,7 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
_, err = stmtSaveDonk.Exec(honk.ID, d.FileID)
|
_, err = stmtSaveDonk.Exec(honk.ID, d.FileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("err saving donk: %s", err)
|
log.Printf("err saving donk: %s", err)
|
||||||
|
http.Error(w, "something bad happened while saving", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue