Skip to content

Commit 11364f9

Browse files
committed
chore(http): add route path to panic log message
1 parent 1ccd0e1 commit 11364f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

http/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (h baseHandler) panic(w http.ResponseWriter, r *http.Request, rcv interface
7676
pe := &platform.Error{
7777
Code: platform.EInternal,
7878
Msg: "a panic has occurred",
79-
Err: fmt.Errorf("%v", rcv),
79+
Err: fmt.Errorf("%s: %v", r.URL.String(), rcv),
8080
}
8181

8282
l := getPanicLogger()

http/router_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func TestRouter_Panic(t *testing.T) {
174174
body: `
175175
{
176176
"code": "internal error",
177-
"message": "a panic has occurred: not implemented"
177+
"message": "a panic has occurred: /ping: not implemented"
178178
}`,
179179
},
180180
},

0 commit comments

Comments
 (0)