MCPcopy
hub / github.com/valyala/fasthttp / defaultErrorHandler

Function defaultErrorHandler

server.go:3105–3113  ·  view source on GitHub ↗
(ctx *RequestCtx, err error)

Source from the content-addressed store, hash-verified

3103}
3104
3105func defaultErrorHandler(ctx *RequestCtx, err error) {
3106 if _, ok := err.(*ErrSmallBuffer); ok {
3107 ctx.Error("Too big request header", StatusRequestHeaderFieldsTooLarge)
3108 } else if netErr, ok := err.(*net.OpError); ok && netErr.Timeout() {
3109 ctx.Error("Request timeout", StatusRequestTimeout)
3110 } else {
3111 ctx.Error("Error when parsing request", StatusBadRequest)
3112 }
3113}
3114
3115func (s *Server) writeErrorResponse(bw *bufio.Writer, ctx *RequestCtx, serverName string, err error) *bufio.Writer {
3116 errorHandler := defaultErrorHandler

Callers

nothing calls this directly

Calls 2

ErrorMethod · 0.45
TimeoutMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…