Skip to content

Commit e0568fd

Browse files
committed
Prevent one error being handled multiple times
1 parent c8736dd commit e0568fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/runtime/internal/Component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function handle_error(component, e, skip = false) {
121121
bubble_error(component, e);
122122
}
123123

124-
if (!skip) {
124+
if (!skip && !e.unhandled) {
125125
component.$$.on_error.forEach(handler => {
126126
try {
127127
handler(e);
@@ -136,6 +136,7 @@ function bubble_error(component, e) {
136136
if (component.$$.parent_component) {
137137
handle_error(component.$$.parent_component, e, component.$$.in_slot);
138138
} else {
139+
e.unhandled = true; // TODO this is very gross
139140
throw e;
140141
}
141142
}

0 commit comments

Comments
 (0)