summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-08-07 18:51:55 -0700
committerraylu <raylu@mixpanel.com>2011-08-07 18:51:55 -0700
commitf07e94efd1453070103776c4002a11467e8b235e (patch)
tree7a0dd2ef9c9eb3ae462f0c9b895432a4428f1524
parentc5856a0d115cb46760a359d45a3a734fc1d51b52 (diff)
downloadaudioaxis-f07e94efd1453070103776c4002a11467e8b235e.tar.xz
HTTP 500 -> 400
-rw-r--r--main.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.go b/main.go
index c5023f6..b10de22 100644
--- a/main.go
+++ b/main.go
@@ -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