pull/16091/head
Rich Harris 4 months ago
parent 91458a012d
commit 0a433d92c6

@ -37,22 +37,19 @@ export function handle_error(error) {
/**
* @param {unknown} error
* @param {Effect} effect
* @param {Effect | null} effect
*/
export function invoke_error_boundary(error, effect) {
/** @type {Effect | null} */
var current = effect;
while (current !== null) {
if ((current.f & BOUNDARY_EFFECT) !== 0) {
while (effect !== null) {
if ((effect.f & BOUNDARY_EFFECT) !== 0) {
try {
// @ts-expect-error
current.fn(error);
effect.fn(error);
return;
} catch {}
}
current = current.parent;
effect = effect.parent;
}
throw error;

Loading…
Cancel
Save