Home / Function/ onResponseCallback() — fastify Function Reference

onResponseCallback() — fastify Function Reference

Architecture documentation for the onResponseCallback() function in reply.js from the fastify codebase.

Entity Profile

Dependency Diagram

graph TD
  622c48bc_586a_8676_332c_4ea39a6d4117["onResponseCallback()"]
  4bcd71dc_1ec2_5fe8_b8ff_4a371e392925["reply.js"]
  622c48bc_586a_8676_332c_4ea39a6d4117 -->|defined in| 4bcd71dc_1ec2_5fe8_b8ff_4a371e392925
  3312a7d2_5a44_4c4d_a8a7_8d1bc568b4c3["setupResponseListeners()"]
  3312a7d2_5a44_4c4d_a8a7_8d1bc568b4c3 -->|calls| 622c48bc_586a_8676_332c_4ea39a6d4117
  style 622c48bc_586a_8676_332c_4ea39a6d4117 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/reply.js lines 911–931

function onResponseCallback (err, request, reply) {
  if (reply.log[kDisableRequestLogging]) {
    return
  }

  const responseTime = reply.elapsedTime

  if (err != null) {
    reply.log.error({
      res: reply,
      err,
      responseTime
    }, 'request errored')
    return
  }

  reply.log.info({
    res: reply,
    responseTime
  }, 'request completed')
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does onResponseCallback() do?
onResponseCallback() is a function in the fastify codebase, defined in lib/reply.js.
Where is onResponseCallback() defined?
onResponseCallback() is defined in lib/reply.js at line 911.
What calls onResponseCallback()?
onResponseCallback() is called by 1 function(s): setupResponseListeners.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free