{"action":"opened","issue":{"url":"https://api.github.com/repos/hashicorp/consul/issues/908","labels_url":"https://api.github.com/repos/hashicorp/consul/issues/908/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul/issues/908/comments","events_url":"https://api.github.com/repos/hashicorp/consul/issues/908/events","html_url":"https://github.com/hashicorp/consul/issues/908","id":73472175,"number":908,"title":"Specifying invalid datacenter in query args returns an 500 instead of 404","user":{"login":"gmr","id":49469,"avatar_url":"https://avatars.githubusercontent.com/u/49469?v=3","gravatar_id":"","url":"https://api.github.com/users/gmr","html_url":"https://github.com/gmr","followers_url":"https://api.github.com/users/gmr/followers","following_url":"https://api.github.com/users/gmr/following{/other_user}","gists_url":"https://api.github.com/users/gmr/gists{/gist_id}","starred_url":"https://api.github.com/users/gmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmr/subscriptions","organizations_url":"https://api.github.com/users/gmr/orgs","repos_url":"https://api.github.com/users/gmr/repos","events_url":"https://api.github.com/users/gmr/events{/privacy}","received_events_url":"https://api.github.com/users/gmr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-06T00:26:17Z","updated_at":"2015-05-06T00:26:17Z","closed_at":null,"body":"When querying the KV database specifying an invalid datacenter value, consul returns a ``500`` ``Internal Server Error`` with a body of ``No path to datacenter``. I believe this should be a ``404`` as a ``500`` generally indicates a problem occurred instead of the filtering criteria not returning any data.\r\n\r\nThis may be a duplicate of #848.\r\n\r\nExample:\r\n\r\n``curl http://localhost:8500/v1/kv/foo?dc=bar``\r\n\r\nOutput:\r\n\r\n```\r\n> GET /v1/kv/foo?dc=bar HTTP/1.1\r\n> User-Agent: curl/7.37.1\r\n> Host: localhost\r\n> Accept: */*\r\n> \r\n< HTTP/1.1 500 Internal Server Error\r\n* Server nginx is not blacklisted\r\n< Server: nginx\r\n< Date: Wed, 06 May 2015 00:24:14 GMT\r\n< Content-Type: text/plain; charset=utf-8\r\n< Content-Length: 21\r\n< Connection: keep-alive\r\n< \r\n* Connection #0 to host localhost left intact\r\nNo path to datacenter\r\n```"}}