()
| 205 | } |
| 206 | |
| 207 | func (s *ServerTestSuite) TestIntoWithError() { |
| 208 | testError := errctx.NewTextError("test error", 0) |
| 209 | mockHandler := func(reqID string, rw server.ResponseWriter, r *http.Request) *server.Error { |
| 210 | return server.NewError(testError, "test-category") |
| 211 | } |
| 212 | |
| 213 | s.router().GET("/test", s.router().WithReportError(mockHandler)) |
| 214 | |
| 215 | req := httptest.NewRequest(http.MethodGet, "/test", nil) |
| 216 | rw := httptest.NewRecorder() |
| 217 | |
| 218 | s.router().ServeHTTP(rw, req) |
| 219 | |
| 220 | s.Equal(http.StatusInternalServerError, rw.Code) |
| 221 | s.Equal("text/plain", rw.Header().Get(httpheaders.ContentType)) |
| 222 | } |
| 223 | |
| 224 | func (s *ServerTestSuite) TestIntoPanicWithError() { |
| 225 | testError := errors.New("panic error") |
nothing calls this directly
no test coverage detected