|
|
|
|
@ -269,11 +269,15 @@ function should_rethrow_error(effect) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {Error} error
|
|
|
|
|
* @param {unknown} error
|
|
|
|
|
* @param {Effect} effect
|
|
|
|
|
* @param {ComponentContext | null} component_context
|
|
|
|
|
*/
|
|
|
|
|
export function handle_error(error, effect, component_context) {
|
|
|
|
|
if (!(error instanceof Error)) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (handled_errors.has(error)) {
|
|
|
|
|
if (should_rethrow_error(effect)) {
|
|
|
|
|
throw error;
|
|
|
|
|
@ -500,7 +504,7 @@ export function update_effect(effect) {
|
|
|
|
|
dev_effect_stack.push(effect);
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
handle_error(/** @type {Error} */ (error), effect, previous_component_context || effect.ctx);
|
|
|
|
|
handle_error(error, effect, previous_component_context || effect.ctx);
|
|
|
|
|
} finally {
|
|
|
|
|
active_effect = previous_effect;
|
|
|
|
|
|
|
|
|
|
@ -601,7 +605,7 @@ function flush_queued_effects(effects) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
handle_error(/** @type {Error} */ (error), effect, effect.ctx);
|
|
|
|
|
handle_error(error, effect, effect.ctx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -681,7 +685,7 @@ function process_effects(effect, collected_effects) {
|
|
|
|
|
update_effect(current_effect);
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
handle_error(/** @type {Error} */ (error), current_effect, current_effect.ctx);
|
|
|
|
|
handle_error(error, current_effect, current_effect.ctx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|