Skip to content

Commit 91458a0

Browse files
committed
WIP
1 parent e243091 commit 91458a0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

packages/svelte/src/internal/client/error-handling.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ export function handle_error(error) {
2020
adjust_error(error, effect);
2121
}
2222

23-
if ((effect.f & EFFECT_RAN) !== 0) {
24-
invoke_error_boundary(error, effect);
25-
} else if ((effect.f & BOUNDARY_EFFECT) !== 0) {
26-
// invoke directly
23+
if ((effect.f & EFFECT_RAN) === 0) {
24+
// if the error occurred while creating this subtree, we let it
25+
// bubble up until it hits a boundary that can handle it
26+
if ((effect.f & BOUNDARY_EFFECT) === 0) {
27+
throw error;
28+
}
29+
30+
// @ts-expect-error
2731
effect.fn(error);
2832
} else {
29-
throw error;
33+
// otherwise we bubble up the effect tree ourselves
34+
invoke_error_boundary(error, effect);
3035
}
3136
}
3237

0 commit comments

Comments
 (0)