MCPcopy Create free account
hub / github.com/ethanniser/the-beth-stack / ErrorBoundary

Function ErrorBoundary

packages/beth-stack/src/jsx/error.tsx:1–14  ·  view source on GitHub ↗
({
  fallback,
  children,
}: {
  fallback: JSX.Element;
  children: JSX.Element | JSX.Element[];
})

Source from the content-addressed store, hash-verified

1export async function ErrorBoundary({
2 fallback,
3 children,
4}: {
5 fallback: JSX.Element;
6 children: JSX.Element | JSX.Element[];
7}): Promise<string> {
8 if (!Array.isArray(children))
9 throw new Error("children isnt array (shouldnt be possible)");
10
11 return Promise.all(children)
12 .then((children) => <>{children}</>)
13 .catch(() => fallback);
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected