register the panic-recover handler after the activity logger

This commit is contained in:
Gani Georgiev
2024-10-18 13:47:10 +03:00
parent dbc074ee9a
commit 6f2fe91da5
6 changed files with 83 additions and 43 deletions

View File

@@ -64,10 +64,6 @@ func TestRouter(t *testing.T) {
calls += "/" + e.Request.PathValue("param")
return errors.New("test") // should be normalized to an ApiError
})
g1.GET("/panic", func(e *router.Event) error {
calls += "/panic"
panic("test")
})
mux, err := r.BuildMux()
if err != nil {
@@ -98,7 +94,6 @@ func TestRouter(t *testing.T) {
{http.MethodHead, "/a/b/1", "root_m:a_b_group_m:1_get_m:/1_get:cleanup"},
{http.MethodPost, "/a/b/1", "root_m:a_b_group_m:/1_post:cleanup"},
{http.MethodGet, "/a/b/456", "root_m:a_b_group_m:/456/error:cleanup"},
{http.MethodGet, "/a/b/panic", "root_m:a_b_group_m:/panic:cleanup"},
}
for _, s := range scenarios {