Skip to content

Commit 328db63

Browse files
committed
change name of the notfound handler
1 parent 396e54c commit 328db63

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

server/error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type errorDetails struct {
1818
MessageSeverity string `json:"message_severity"`
1919
}
2020

21-
func notFoundHandler(w http.ResponseWriter, r *http.Request) {
21+
func notFoundError(w http.ResponseWriter, r *http.Request) {
2222
instrumentation.IncrementNotFound()
2323
w.Header().Set("Content-Type", "application/json")
2424

server/error_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func Test404Handler(t *testing.T) {
1212
w := httptest.NewRecorder()
1313
r := httptest.NewRequest("GET", "/hello", nil)
1414

15-
notFoundHandler(w, r)
15+
notFoundError(w, r)
1616

1717
assert.Equal(t, http.StatusNotFound, w.Code)
1818
assert.Equal(t, "{\"errors\":[{\"code\":\"weaver:route:not_found\",\"message\":\"Something went wrong\",\"message_title\":\"Failure\",\"message_severity\":\"failure\"}]}", w.Body.String())

server/handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (proxy *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
3030
if err != nil || acl == nil {
3131
logger.Errorrf(r, "failed to find route: %+v for request: %s", err, r.URL.String())
3232

33-
notFoundHandler(rw, r)
33+
notFoundError(rw, r)
3434
return
3535
}
3636

0 commit comments

Comments
 (0)