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
  672bd90b_9403_b6bf_f187_b5f0805970e0["invokeWithErrorHandling()"]
  217ad03c_63ee_50df_35b4_38fbc8b99b73["isPromise()"]
  672bd90b_9403_b6bf_f187_b5f0805970e0 -->|calls| 217ad03c_63ee_50df_35b4_38fbc8b99b73
  d7e380c9_1d94_4f54_9ce8_7ba29b261101["handleError()"]
  672bd90b_9403_b6bf_f187_b5f0805970e0 -->|calls| d7e380c9_1d94_4f54_9ce8_7ba29b261101
  style 672bd90b_9403_b6bf_f187_b5f0805970e0 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