diff --git a/CHANGELOG.md b/CHANGELOG.md index 02e179823f..e00a39c0c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ### Features - [#2000](https://github.com/influxdb/influxdb/pull/2000): Log broker path when broker fails to start. Thanks @gst. +### Bugfixes +- [#2001](https://github.com/influxdb/influxdb/pull/2001): Ensure measurement not found returns status code 200. + ## v0.9.0-rc14 [2015-03-18] ### Bugfixes diff --git a/httpd/handler.go b/httpd/handler.go index c8eaa196ce..94adc9554c 100644 --- a/httpd/handler.go +++ b/httpd/handler.go @@ -441,7 +441,7 @@ func isAuthorizationError(err error) bool { func isMeasurementNotFoundError(err error) bool { s := err.Error() - return strings.HasPrefix(s, "measurement") && strings.HasSuffix(s, "not found") + return strings.HasPrefix(s, "measurement") && strings.HasSuffix(s, "not found") || strings.Contains(s, "measurement not found") } func isFieldNotFoundError(err error) bool { diff --git a/httpd/handler_test.go b/httpd/handler_test.go index 3aba2671c7..b0f7d620f7 100644 --- a/httpd/handler_test.go +++ b/httpd/handler_test.go @@ -153,6 +153,12 @@ func TestHandler_ShowMeasurementsNotFound(t *testing.T) { } else if body != `{"results":[{"error":"measurement \"bin\" not found"}]}` { t.Fatalf("unexpected body: %s", body) } + status, body = MustHTTP("GET", s.URL+`/query`, map[string]string{"q": "SELECT * FROM bin", "db": "foo"}, nil, "") + if status != http.StatusOK { + t.Fatalf("unexpected status: %d", status) + } else if body != `{"results":[{"error":"measurement not found: \"foo\".\"bar\".\"bin\""}]}` { + t.Fatalf("unexpected body: %s", body) + } } func TestHandler_Databases(t *testing.T) {