fixup deletion handler more
This commit is contained in:
parent
4e6b1b6c96
commit
a97131a5c0
9
main.go
9
main.go
|
@ -119,10 +119,11 @@ func delHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
check(err)
|
check(err)
|
||||||
|
|
||||||
affect, err := res.RowsAffected()
|
affect, err := res.RowsAffected()
|
||||||
check(err)
|
if err == sql.ErrNoRows {
|
||||||
|
io.WriteString(w, "Error invalid paste")
|
||||||
io.WriteString(w, string(affect))
|
} else {
|
||||||
|
io.WriteString(w, paste+" deleted")
|
||||||
|
}
|
||||||
db.Close()
|
db.Close()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue