Home / Function/ handleError() — vue Function Reference

handleError() — vue Function Reference

Architecture documentation for the handleError() function in error.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  b8db5ebb_37ca_9a58_b300_9c9942dd0428["handleError()"]
  b1da1eab_0638_a7c0_5de0_1f3b86ec2f97["invokeWithErrorHandling()"]
  b1da1eab_0638_a7c0_5de0_1f3b86ec2f97 -->|calls| b8db5ebb_37ca_9a58_b300_9c9942dd0428
  c7b631c5_e768_3daa_7580_aa7f38598d78["nextTick()"]
  c7b631c5_e768_3daa_7580_aa7f38598d78 -->|calls| b8db5ebb_37ca_9a58_b300_9c9942dd0428
  0f6ffc11_2e95_459d_b27e_bbd8d5d18e4a["pushTarget()"]
  b8db5ebb_37ca_9a58_b300_9c9942dd0428 -->|calls| 0f6ffc11_2e95_459d_b27e_bbd8d5d18e4a
  d1be0b2a_abc4_ab7d_605c_3ca7e9b6c3db["globalHandleError()"]
  b8db5ebb_37ca_9a58_b300_9c9942dd0428 -->|calls| d1be0b2a_abc4_ab7d_605c_3ca7e9b6c3db
  a51c7238_0b82_ad88_085b_cd519eb78568["popTarget()"]
  b8db5ebb_37ca_9a58_b300_9c9942dd0428 -->|calls| a51c7238_0b82_ad88_085b_cd519eb78568
  style b8db5ebb_37ca_9a58_b300_9c9942dd0428 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/util/error.ts lines 7–32

export function handleError(err: Error, vm: any, info: string) {
  // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  // See: https://github.com/vuejs/vuex/issues/1505
  pushTarget()
  try {
    if (vm) {
      let cur = vm
      while ((cur = cur.$parent)) {
        const hooks = cur.$options.errorCaptured
        if (hooks) {
          for (let i = 0; i < hooks.length; i++) {
            try {
              const capture = hooks[i].call(cur, err, vm, info) === false
              if (capture) return
            } catch (e: any) {
              globalHandleError(e, cur, 'errorCaptured hook')
            }
          }
        }
      }
    }
    globalHandleError(err, vm, info)
  } finally {
    popTarget()
  }
}

Domain

Subdomains

Frequently Asked Questions

What does handleError() do?
handleError() is a function in the vue codebase.
What does handleError() call?
handleError() calls 3 function(s): globalHandleError, popTarget, pushTarget.
What calls handleError()?
handleError() is called by 2 function(s): invokeWithErrorHandling, nextTick.

Analyze Your Own Codebase

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

Try Supermodel Free