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,18 +345,17 @@ export function update_reaction(reaction) {
return result;
} catch (error) {
// TODO think we can just use active_effect here?
var effect = get_effect(reaction);
if (effect) {
if ((effect.f & EFFECT_RAN) !== 0) {
invoke_error_boundary(error, effect);
} else if ((effect.f & BOUNDARY_EFFECT) !== 0) {
// invoke directly
effect.fn(error);
} else {
throw error;
}
var effect = /** @type {Effect} */ (active_effect);
if (DEV && error instanceof Error) {
adjust_error(error, effect);
}
if ((effect.f & EFFECT_RAN) !== 0) {
invoke_error_boundary(error, effect);
} else if ((effect.f & BOUNDARY_EFFECT) !== 0) {
// invoke directly
effect.fn(error);
} else {
throw error;
}

Loading…
Cancel
Save