(t *testing.T)
| 686 | } |
| 687 | |
| 688 | func Test_DefaultErrorHandler_WrappedFiberErrorUsesWrappedMessage(t *testing.T) { |
| 689 | t.Parallel() |
| 690 | |
| 691 | app := New() |
| 692 | c := app.AcquireCtx(&fasthttp.RequestCtx{}).(*DefaultCtx) //nolint:errcheck,forcetypeassert // not needed |
| 693 | t.Cleanup(func() { app.ReleaseCtx(c) }) |
| 694 | |
| 695 | err := fmt.Errorf("auth failed: %w", ErrUnauthorized) |
| 696 | require.NoError(t, DefaultErrorHandler(c, err)) |
| 697 | require.Equal(t, StatusUnauthorized, c.fasthttp.Response.StatusCode()) |
| 698 | require.Equal(t, err.Error(), string(c.fasthttp.Response.Body())) |
| 699 | } |
| 700 | |
| 701 | func Test_App_serverErrorHandler_Internal_Error(t *testing.T) { |
| 702 | t.Parallel() |
nothing calls this directly
no test coverage detected