* Logs stream-level errors that occur after headers have been sent. * Premature closes are logged at `info`; other errors at `warn`. * * @param {Error} error The stream error. * @param {object} request Fastify request object. * @param {object} reply Fastify reply o
(error, request, reply, metadata)
| 98 | * @param {object} [metadata] Extra contextual data (unused). |
| 99 | */ |
| 100 | streamError (error, request, reply, metadata) { |
| 101 | if (this.isLogDisabled(request)) { return } |
| 102 | |
| 103 | if (error.code === 'ERR_STREAM_PREMATURE_CLOSE') { |
| 104 | reply.log.info({ res: reply }, 'stream closed prematurely') |
| 105 | } else { |
| 106 | reply.log.warn({ err: error }, 'response terminated with an error with headers already sent') |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Logs a "route not found" message at `info` level. |
no test coverage detected