diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -60,7 +60,7 @@ func add(w http.ResponseWriter, r *http.Request) { q := r.URL.Query() pid := getpid(q.Get("pid")) if pid == -1 { - http.Error(w, "invalid pid", http.StatusInternalServerError) + http.Error(w, "invalid pid", http.StatusBadRequest) return } @@ -84,7 +84,7 @@ func remove(w http.ResponseWriter, r *http.Request) { q := r.URL.Query() pid := getpid(q.Get("pid")) if pid == -1 { - http.Error(w, "invalid pid", http.StatusInternalServerError) + http.Error(w, "invalid pid", http.StatusBadRequest) return } @@ -104,7 +104,7 @@ func move(w http.ResponseWriter, r *http.Request) { q := r.URL.Query() pid := getpid(q.Get("pid")) if pid == -1 { - http.Error(w, "invalid pid", http.StatusInternalServerError) + http.Error(w, "invalid pid", http.StatusBadRequest) return } @@ -132,7 +132,7 @@ func move(w http.ResponseWriter, r *http.Request) { } else if direction == moveDownAction { newOrder++ } else { - http.Error(w, "invalid direction or cannot move up", http.StatusInternalServerError) + http.Error(w, "invalid direction or cannot move up", http.StatusBadRequest) return } @@ -144,7 +144,7 @@ func move(w http.ResponseWriter, r *http.Request) { return } else if db.AffectedRows != 1 { db.Rollback() - http.Error(w, "invalid direction for this song", http.StatusInternalServerError) + http.Error(w, "invalid direction for this song", http.StatusBadRequest) return } // there are now two songs with that order, so also check yid |