Merge pull request #299 from rancherio/send-500-error

When an unknown error occurs set the HTTP status code to 500
This commit is contained in:
Victor Marmol 2014-11-12 11:20:08 -08:00
commit fbafdbb860

View File

@ -51,7 +51,7 @@ func RegisterHandlers(m manager.Manager) error {
http.HandleFunc(apiResource, func(w http.ResponseWriter, r *http.Request) {
err := handleRequest(m, w, r)
if err != nil {
fmt.Fprintf(w, "%s", err)
http.Error(w, err.Error(), 500)
}
})