Home / Function/ invokeWithErrorHandling() — vue Function Reference

invokeWithErrorHandling() — vue Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b1da1eab_0638_a7c0_5de0_1f3b86ec2f97["invokeWithErrorHandling()"]
  0e84e356_4bdc_43af_0280_fca4f02bddb8["isPromise()"]
  b1da1eab_0638_a7c0_5de0_1f3b86ec2f97 -->|calls| 0e84e356_4bdc_43af_0280_fca4f02bddb8
  b8db5ebb_37ca_9a58_b300_9c9942dd0428["handleError()"]
  b1da1eab_0638_a7c0_5de0_1f3b86ec2f97 -->|calls| b8db5ebb_37ca_9a58_b300_9c9942dd0428
  style b1da1eab_0638_a7c0_5de0_1f3b86ec2f97 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/util/error.ts lines 34–54

export function invokeWithErrorHandling(
  handler: Function,
  context: any,
  args: null | any[],
  vm: any,
  info: string
) {
  let res
  try {
    res = args ? handler.apply(context, args) : handler.call(context)
    if (res && !res._isVue && isPromise(res) && !(res as any)._handled) {
      res.catch(e => handleError(e, vm, info + ` (Promise/async)`))
      // issue #9511
      // avoid catch triggering multiple times when nested calls
      ;(res as any)._handled = true
    }
  } catch (e: any) {
    handleError(e, vm, info)
  }
  return res
}

Domain

Subdomains

Frequently Asked Questions

What does invokeWithErrorHandling() do?
invokeWithErrorHandling() is a function in the vue codebase.
What does invokeWithErrorHandling() call?
invokeWithErrorHandling() calls 2 function(s): handleError, isPromise.

Analyze Your Own Codebase

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

Try Supermodel Free