diff --git a/packages/runtime-core/src/errorHandling.ts b/packages/runtime-core/src/errorHandling.ts index 095661218c6..b6f27be0445 100644 --- a/packages/runtime-core/src/errorHandling.ts +++ b/packages/runtime-core/src/errorHandling.ts @@ -68,7 +68,15 @@ export function callWithErrorHandling( try { res = args ? fn(...args) : fn() } catch (err) { - handleError(err, instance, type) + // if the error handler throws error, rethrow it + if ( + type === ErrorCodes.APP_ERROR_HANDLER || + type === ErrorCodes.APP_WARN_HANDLER + ) { + throw err + } else { + handleError(err, instance, type) + } } return res }