Skip to content

Commit 99ae4c9

Browse files
committed
tweak
1 parent 4e2626f commit 99ae4c9

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,11 @@ function propagate_error(error, effect) {
244244
// @ts-ignore
245245
current.fn({ error });
246246
} catch {
247-
set_signal_status(current, DESTROYED);
248247
current = parent;
249248
continue;
250249
}
251250
return;
252251
}
253-
set_signal_status(current, DESTROYED);
254252
current = parent;
255253
}
256254

@@ -263,8 +261,12 @@ function propagate_error(error, effect) {
263261
* @param {ComponentContext | null} component_context
264262
*/
265263
function handle_error(error, effect, component_context) {
266-
// Given we don't yet have error boundaries, we will just always throw.
267-
if (!DEV || handled_errors.has(error) || component_context === null) {
264+
if (handled_errors.has(error)) {
265+
return;
266+
}
267+
handled_errors.add(error);
268+
269+
if (!DEV || component_context === null) {
268270
propagate_error(error, effect);
269271
return;
270272
}
@@ -317,7 +319,6 @@ function handle_error(error, effect, component_context) {
317319
});
318320
}
319321

320-
handled_errors.add(error);
321322
propagate_error(error, effect);
322323
}
323324

@@ -479,14 +480,9 @@ export function update_effect(effect) {
479480
dev_effect_stack.push(effect);
480481
}
481482
} catch (error) {
482-
if ((effect.f & DESTROYED) === 0) {
483-
handle_error(/** @type {Error} */ (error), effect, previous_component_context);
484-
}
483+
handle_error(/** @type {Error} */ (error), effect, previous_component_context);
485484

486-
if (
487-
(flags & ROOT_EFFECT) !== 0 ||
488-
(effect.parent !== null && (effect.parent.f & BOUNDARY_EFFECT) === 0)
489-
) {
485+
if (effect.parent !== null && (effect.parent.f & BOUNDARY_EFFECT) === 0) {
490486
throw error;
491487
}
492488
} finally {

0 commit comments

Comments
 (0)