( fn: Function, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, args?: unknown[], )
| 68 | export type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes |
| 69 | |
| 70 | export function callWithErrorHandling( |
| 71 | fn: Function, |
| 72 | instance: ComponentInternalInstance | null | undefined, |
| 73 | type: ErrorTypes, |
| 74 | args?: unknown[], |
| 75 | ): any { |
| 76 | try { |
| 77 | return args ? fn(...args) : fn() |
| 78 | } catch (err) { |
| 79 | handleError(err, instance, type) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | export function callWithAsyncErrorHandling( |
| 84 | fn: Function | Function[], |
no test coverage detected