MCPcopy
hub / github.com/Allenxuxu/gev / writeErrorText

Function writeErrorText

plugins/websocket/ws/http.go:261–268  ·  view source on GitHub ↗
(bw *bufio.Writer, err error)

Source from the content-addressed store, hash-verified

259}
260
261func writeErrorText(bw *bufio.Writer, err error) {
262 body := err.Error()
263 _, _ = bw.WriteString("Content-Length: ")
264 _, _ = bw.WriteString(strconv.Itoa(len(body)))
265 _, _ = bw.WriteString(crlf)
266 _, _ = bw.WriteString(crlf)
267 _, _ = bw.WriteString(body)
268}
269
270// statusText is a non-performant status text generator.
271// NOTE: Used only to generate constants.

Callers 2

httpWriteResponseErrorFunction · 0.85
errorTextFunction · 0.85

Calls 2

WriteStringMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected