feat: error handling for setup / render / watch / event handlers
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
currentInstance,
|
||||
setCurrentInstance
|
||||
} from './component'
|
||||
import { callUserFnWithErrorHandling, ErrorTypeStrings } from './errorHandling'
|
||||
import { callWithAsyncErrorHandling, ErrorTypeStrings } from './errorHandling'
|
||||
import { warn } from './warning'
|
||||
import { capitalize } from '@vue/shared'
|
||||
|
||||
@@ -19,7 +19,7 @@ function injectHook(
|
||||
// This assumes the hook does not synchronously trigger other hooks, which
|
||||
// can only be false when the user does something really funky.
|
||||
setCurrentInstance(target)
|
||||
const res = callUserFnWithErrorHandling(hook, target, type, args)
|
||||
const res = callWithAsyncErrorHandling(hook, target, type, args)
|
||||
setCurrentInstance(null)
|
||||
return res
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user