MCPcopy
hub / github.com/fastify/fastify / clientErrorHandler

Function clientErrorHandler

test/reply-error.test.js:149–154  ·  view source on GitHub ↗
(err, socket)

Source from the content-addressed store, hash-verified

147 const response = `HTTP/1.1 400 Bad Request\r\nContent-Length: ${responseBody.length}\r\nContent-Type: application/json; charset=utf-8\r\n\r\n${responseBody}`
148
149 function clientErrorHandler (err, socket) {
150 t.assert.ok(err instanceof Error)
151
152 this.log.warn({ err }, 'Handled client error')
153 socket.end(response)
154 }
155
156 const logStream = split(JSON.parse)
157 const fastify = Fastify({

Callers

nothing calls this directly

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected