MCPcopy
hub / github.com/fastify/fastify / fourOhFourFallBack

Function fourOhFourFallBack

lib/four-oh-four.js:175–192  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

173 }
174
175 function fourOhFourFallBack (req, res) {
176 // if this happen, we have a very bad bug
177 // we might want to do some hard debugging
178 // here, let's print out as much info as
179 // we can
180 const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext]
181 const id = getGenReqId(fourOhFourContext.server, req)
182 const childLogger = createChildLogger(fourOhFourContext, logger, req, id)
183
184 childLogger.info({ req }, 'incoming request')
185
186 const request = new Request(id, null, req, null, childLogger, fourOhFourContext)
187 const reply = new Reply(res, request, childLogger)
188
189 request.log.warn('the default handler for 404 did not catch this, this is likely a fastify bug, please report it')
190 request.log.warn(router.prettyPrint())
191 reply.code(404).send(new FST_ERR_NOT_FOUND())
192 }
193}
194
195module.exports = fourOhFour

Callers

nothing calls this directly

Calls 6

getGenReqIdFunction · 0.85
createChildLoggerFunction · 0.85
infoMethod · 0.80
warnMethod · 0.80
sendMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected