chore: highlight swallowed errors from await blocks in DEV

pull/13819/head
Dominic Gannaway 2 years ago
parent 6577d99806
commit 6f052ab222

@ -80,13 +80,9 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
else then_effect = branch(() => then_fn(anchor, input_source));
}
if (state === CATCH) {
if (catch_fn) {
if (state === CATCH && catch_fn) {
if (catch_effect) resume_effect(catch_effect);
else catch_effect = branch(() => catch_fn(anchor, error_source));
} else if (DEV) {
console.error(error_source.v);
}
}
if (state !== PENDING && pending_effect) {
@ -135,6 +131,10 @@ export function await_block(node, get_input, pending_fn, then_fn, catch_fn) {
// but let's use internal_set for consistency and just to be safe
internal_set(error_source, error);
update(CATCH, true);
if (!catch_fn && DEV) {
// eslint-disable-next-line no-console
console.error(error_source.v);
}
}
);

Loading…
Cancel
Save