async function handle_error_and_jsonify(event, options, error) {
	if (error instanceof HttpError) {
		return error.body;
	}

	if (__SVELTEKIT_DEV__ && typeof error == 'object') {
		fix_stack_trace(error);
	}

	const status = get_status(error);
	const message = get_message(error);

	return (
		(await with_event(event, () =>
			options.hooks.handleError({ error, event, status, message })
		)) ?? { message }
	);
}
@param {import('@sveltejs/kit').RequestEvent} event
@param {import('types').SSROptions} options
@param {any} error
@returns {Promise<App.Error>}