diff --git a/blocks/loader.ts b/blocks/loader.ts index 284482c0c..d8118d329 100644 --- a/blocks/loader.ts +++ b/blocks/loader.ts @@ -6,7 +6,7 @@ import type { Block, BlockModule, InstanceOf } from "../engine/block.ts"; import { FieldResolver } from "../engine/core/resolver.ts"; import { singleFlight } from "../engine/core/utils.ts"; import type { DecofileProvider } from "../engine/decofile/provider.ts"; -import { HttpError } from "../engine/errors.ts"; + import type { ResolverMiddlewareContext } from "../engine/middleware.ts"; import type { State } from "../mod.ts"; import { logger } from "../observability/otel/config.ts"; @@ -106,9 +106,6 @@ export const wrapCaughtErrors = async < try { return await ctx.next!(); } catch (err) { - if (err instanceof HttpError) { - throw err; - } return new Proxy({}, { get: (_target, prop) => { if (prop === "then") { diff --git a/blocks/section.ts b/blocks/section.ts index 7f655e78c..31dafc393 100644 --- a/blocks/section.ts +++ b/blocks/section.ts @@ -19,7 +19,7 @@ import type { PreactComponent, } from "../engine/block.ts"; import type { Resolver } from "../engine/core/resolver.ts"; -import { HttpError } from "../engine/errors.ts"; + /** * @widget none @@ -155,9 +155,6 @@ export const createSectionBlock = ( ).then((props) => { return useExportDefaultComponentWithProps(props, httpCtx); }).catch((err) => { - if (err instanceof HttpError) { - throw err; - } const allowErrorBoundary = withMainComponent(alwaysThrow(err), props); return allowErrorBoundary( props as unknown as TProps, diff --git a/components/section.tsx b/components/section.tsx index 4c92e482d..7ec43e54a 100644 --- a/components/section.tsx +++ b/components/section.tsx @@ -15,7 +15,7 @@ import { Context } from "../deco.ts"; import { type DeepPartial, Murmurhash3 } from "../deps.ts"; import type { ComponentFunc, ComponentMetadata } from "../engine/block.ts"; import type { FieldResolver } from "../engine/core/resolver.ts"; -import { HttpError } from "../engine/errors.ts"; + import { logger } from "../observability/otel/config.ts"; import { useFramework } from "../runtime/handler.tsx"; import { type Device, deviceOf } from "../utils/userAgent.ts"; @@ -70,9 +70,6 @@ export class ErrorBoundary extends Component { override state = { error: null }; static override getDerivedStateFromError(error: Error) { - if (error instanceof HttpError) { - throw error; - } return { error }; }