From dcbd613e3098cea0dd41511e3da00992085bf90e Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 6 Jun 2025 08:16:39 -0400 Subject: [PATCH] WIP --- packages/svelte/src/internal/client/dom/blocks/boundary.js | 6 +++--- packages/svelte/src/internal/client/error-handling.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/svelte/src/internal/client/dom/blocks/boundary.js b/packages/svelte/src/internal/client/dom/blocks/boundary.js index 634fed0607..2387b22f51 100644 --- a/packages/svelte/src/internal/client/dom/blocks/boundary.js +++ b/packages/svelte/src/internal/client/dom/blocks/boundary.js @@ -2,7 +2,7 @@ import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT } from '#client/constants'; import { component_context, set_component_context } from '../../context.js'; -import { reset_is_throwing_error } from '../../error-handling.js'; +import { invoke_error_boundary, reset_is_throwing_error } from '../../error-handling.js'; import { block, branch, destroy_effect, pause_effect } from '../../reactivity/effects.js'; import { active_effect, @@ -115,8 +115,8 @@ export function boundary(node, props, boundary_fn) { () => reset ); }); - } catch { - // do nothing, handle_error has already been invoked + } catch (error) { + invoke_error_boundary(error, /** @type {Effect} */ (boundary.parent)); } reset_is_throwing_error(); diff --git a/packages/svelte/src/internal/client/error-handling.js b/packages/svelte/src/internal/client/error-handling.js index eaca6cf390..19f6cba2b8 100644 --- a/packages/svelte/src/internal/client/error-handling.js +++ b/packages/svelte/src/internal/client/error-handling.js @@ -51,7 +51,7 @@ export function invoke_error_boundary(error, effect) { current.fn(error); return; } catch { - // Remove boundary flag from effect + // Remove boundary flag from effect (TODO is this still useful?) current.f ^= BOUNDARY_EFFECT; } }