writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
(ctx context.Context, resp http.ResponseWriter, err error)
| 264 | // writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. |
| 265 | // If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err) |
| 266 | func (s *telemetryAPIServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) { |
| 267 | writeError(ctx, resp, err, s.hooks) |
| 268 | } |
| 269 | |
| 270 | // handleRequestBodyError is used to handle error when the twirp server cannot read request |
| 271 | func (s *telemetryAPIServer) handleRequestBodyError(ctx context.Context, resp http.ResponseWriter, msg string, err error) { |
no test coverage detected