Home / Function/ onErrorHook() — fastify Function Reference

onErrorHook() — fastify Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b["onErrorHook()"]
  4bcd71dc_1ec2_5fe8_b8ff_4a371e392925["reply.js"]
  d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b -->|defined in| 4bcd71dc_1ec2_5fe8_b8ff_4a371e392925
  86dc4e98_212d_2b7c_7128_76f05e7a8787["send()"]
  86dc4e98_212d_2b7c_7128_76f05e7a8787 -->|calls| d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b
  bf139b43_eb7c_4f05_1cbe_0dea5d44a338["preSerializationHookEnd()"]
  bf139b43_eb7c_4f05_1cbe_0dea5d44a338 -->|calls| d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b
  76c4faa7_bbf0_a580_fab9_e5bbf7ee7506["wrapOnSendEnd()"]
  76c4faa7_bbf0_a580_fab9_e5bbf7ee7506 -->|calls| d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b
  e86de8a4_fcf2_726c_6613_1273524e94e2["sendWebStream()"]
  e86de8a4_fcf2_726c_6613_1273524e94e2 -->|calls| d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b
  3d4cff63_882d_17c7_3219_d30292baf81d["sendStream()"]
  3d4cff63_882d_17c7_3219_d30292baf81d -->|calls| d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b
  style d1d39f22_2d9a_4ca3_4bbe_11322ac6d36b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/reply.js lines 870–883

function onErrorHook (reply, error, cb) {
  if (reply[kRouteContext].onError !== null && !reply[kReplyNextErrorHandler]) {
    reply[kReplyIsRunningOnErrorHook] = true
    onSendHookRunner(
      reply[kRouteContext].onError,
      reply.request,
      reply,
      error,
      () => handleError(reply, error, cb)
    )
  } else {
    handleError(reply, error, cb)
  }
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does onErrorHook() do?
onErrorHook() is a function in the fastify codebase, defined in lib/reply.js.
Where is onErrorHook() defined?
onErrorHook() is defined in lib/reply.js at line 870.
What calls onErrorHook()?
onErrorHook() is called by 5 function(s): preSerializationHookEnd, send, sendStream, sendWebStream, wrapOnSendEnd.

Analyze Your Own Codebase

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

Try Supermodel Free