Skip to content

Commit

Permalink
Prevent one error being handled multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
rster2002 committed Aug 8, 2021
1 parent c8736dd commit e0568fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/internal/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function handle_error(component, e, skip = false) {
bubble_error(component, e);
}

if (!skip) {
if (!skip && !e.unhandled) {
component.$$.on_error.forEach(handler => {
try {
handler(e);
Expand All @@ -136,6 +136,7 @@ function bubble_error(component, e) {
if (component.$$.parent_component) {
handle_error(component.$$.parent_component, e, component.$$.in_slot);
} else {
e.unhandled = true; // TODO this is very gross
throw e;
}
}
Expand Down

0 comments on commit e0568fd

Please sign in to comment.