pull/16091/head
Rich Harris 4 months ago
parent 4c33df256e
commit 5256e491eb

@ -77,7 +77,7 @@ function should_rethrow_error(effect) {
* @param {Error} error
* @param {Effect} effect
*/
function adjust_error(error, effect) {
export function adjust_error(error, effect) {
if (adjusted_errors.has(error)) return;
adjusted_errors.add(error);

@ -40,7 +40,7 @@ import {
set_component_context,
set_dev_current_component_function
} from './context.js';
import { handle_error, invoke_error_boundary } from './error-handling.js';
import { adjust_error, handle_error, invoke_error_boundary } from './error-handling.js';
let is_flushing = false;
@ -345,10 +345,12 @@ export function update_reaction(reaction) {
return result;
} catch (error) {
// TODO think we can just use active_effect here?
var effect = get_effect(reaction);
var effect = /** @type {Effect} */ (active_effect);
if (DEV && error instanceof Error) {
adjust_error(error, effect);
}
if (effect) {
if ((effect.f & EFFECT_RAN) !== 0) {
invoke_error_boundary(error, effect);
} else if ((effect.f & BOUNDARY_EFFECT) !== 0) {
@ -357,9 +359,6 @@ export function update_reaction(reaction) {
} else {
throw error;
}
} else {
throw error;
}
} finally {
new_deps = previous_deps;
skipped_deps = previous_skipped_deps;

Loading…
Cancel
Save