diff options
author | raylu <raylu@mixpanel.com> | 2011-08-07 18:51:55 -0700 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2011-08-07 18:51:55 -0700 |
commit | f07e94efd1453070103776c4002a11467e8b235e (patch) | |
tree | 7a0dd2ef9c9eb3ae462f0c9b895432a4428f1524 | |
parent | c5856a0d115cb46760a359d45a3a734fc1d51b52 (diff) | |
download | audioaxis-f07e94efd1453070103776c4002a11467e8b235e.tar.xz |
HTTP 500 -> 400
-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 |