fixup deletion handler more

This commit is contained in:
Eliot Whalan 2016-06-23 14:00:27 +10:00
parent 4e6b1b6c96
commit a97131a5c0
No known key found for this signature in database
GPG Key ID: C0A42175139840D6
1 changed files with 5 additions and 4 deletions

View File

@ -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()
} }