|
|
@ -1,17 +1,23 @@
|
|
|
|
/** @import { Effect } from '#client' */
|
|
|
|
/** @import { Derived, Effect } from '#client' */
|
|
|
|
/** @import { Boundary } from './dom/blocks/boundary.js' */
|
|
|
|
/** @import { Boundary } from './dom/blocks/boundary.js' */
|
|
|
|
import { DEV } from 'esm-env';
|
|
|
|
import { DEV } from 'esm-env';
|
|
|
|
import { FILENAME } from '../../constants.js';
|
|
|
|
import { FILENAME } from '../../constants.js';
|
|
|
|
import { is_firefox } from './dom/operations.js';
|
|
|
|
import { is_firefox } from './dom/operations.js';
|
|
|
|
import { BOUNDARY_EFFECT, EFFECT_RAN } from './constants.js';
|
|
|
|
import { ASYNC_ERROR, BOUNDARY_EFFECT, EFFECT_RAN } from './constants.js';
|
|
|
|
import { define_property, get_descriptor } from '../shared/utils.js';
|
|
|
|
import { define_property, get_descriptor } from '../shared/utils.js';
|
|
|
|
import { active_effect } from './runtime.js';
|
|
|
|
import { active_effect, active_reaction } from './runtime.js';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {unknown} error
|
|
|
|
* @param {unknown} error
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export function handle_error(error) {
|
|
|
|
export function handle_error(error) {
|
|
|
|
var effect = /** @type {Effect} */ (active_effect);
|
|
|
|
var effect = active_effect;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for unowned deriveds, don't throw until we read the value
|
|
|
|
|
|
|
|
if (effect === null) {
|
|
|
|
|
|
|
|
/** @type {Derived} */ (active_reaction).f |= ASYNC_ERROR;
|
|
|
|
|
|
|
|
return error;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (DEV && error instanceof Error) {
|
|
|
|
if (DEV && error instanceof Error) {
|
|
|
|
// adjust_error(error, effect);
|
|
|
|
// adjust_error(error, effect);
|
|
|
|