Skip to content

Commit bbb3541

Browse files
committed
tweak
1 parent 24cd820 commit bbb3541

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/svelte/src/internal/client/runtime.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ function propagate_error(error, effect) {
262262
*/
263263
function handle_error(error, effect, component_context) {
264264
if (handled_errors.has(error)) {
265+
// If the parent is not an error boundary then re-throw the error
266+
if (effect.parent === null || (effect.parent.f & BOUNDARY_EFFECT) === 0) {
267+
throw error;
268+
}
265269
return;
266270
}
267271
handled_errors.add(error);
@@ -481,13 +485,6 @@ export function update_effect(effect) {
481485
}
482486
} catch (error) {
483487
handle_error(/** @type {Error} */ (error), effect, previous_component_context);
484-
485-
if (
486-
(flags & ROOT_EFFECT) !== 0 ||
487-
(effect.parent !== null && (effect.parent.f & BOUNDARY_EFFECT) === 0)
488-
) {
489-
throw error;
490-
}
491488
} finally {
492489
active_effect = previous_effect;
493490

0 commit comments

Comments
 (0)