(t *testing.T)
| 772 | } |
| 773 | |
| 774 | func Test_Router_Handler_Catch_Error(t *testing.T) { |
| 775 | t.Parallel() |
| 776 | |
| 777 | app := New() |
| 778 | app.config.ErrorHandler = func(_ Ctx, _ error) error { |
| 779 | return errors.New("fake error") |
| 780 | } |
| 781 | |
| 782 | app.Get("/", func(_ Ctx) error { |
| 783 | return ErrForbidden |
| 784 | }) |
| 785 | |
| 786 | c := &fasthttp.RequestCtx{} |
| 787 | |
| 788 | app.Handler()(c) |
| 789 | |
| 790 | require.Equal(t, StatusInternalServerError, c.Response.Header.StatusCode()) |
| 791 | } |
| 792 | |
| 793 | func Test_Router_NotFound(t *testing.T) { |
| 794 | t.Parallel() |
nothing calls this directly
no test coverage detected