MCPcopy
hub / github.com/fastify/fastify / exit

Function exit

lib/hooks.js:100–117  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

98 next()
99
100 function exit (err) {
101 const hookFnName = hooks[i - 1]?.name
102 const hookFnFragment = hookFnName ? ` "${hookFnName}"` : ''
103
104 if (err) {
105 if (err.code === 'AVV_ERR_READY_TIMEOUT') {
106 err = appendStackTrace(err, new FST_ERR_HOOK_TIMEOUT(hookName, hookFnFragment))
107 } else {
108 err = AVVIO_ERRORS_MAP[err.code] != null
109 ? appendStackTrace(err, new AVVIO_ERRORS_MAP[err.code](err.message))
110 : err
111 }
112
113 cb(err)
114 return
115 }
116 cb()
117 }
118
119 function next (err) {
120 if (err) {

Callers 1

nextFunction · 0.85

Calls 2

appendStackTraceFunction · 0.85
cbFunction · 0.85

Tested by

no test coverage detected