UNPKG

@shopify/shopify-app-remix

Version:

Shopify Remix - to simplify the building of Shopify Apps with Remix

1 lines 1.34 kB
{"version":3,"file":"index.mjs","sources":["../../../../../src/server/boundary/index.ts"],"sourcesContent":["import {headersBoundary} from './headers';\nimport {errorBoundary} from './error';\n\n/**\n * A collection of functions that handle the necessary code for error boundaries in routes using authenticate.admin.\n */\nexport const boundary = {\n /**\n * A function that handles errors or thrown responses.\n *\n * @example\n * <caption>Catching errors in a route</caption>\n * ```ts\n * // /app/routes/admin/widgets.ts\n * import { boundary } from \"@shopify/shopify-app-remix/server\";\n *\n * export function ErrorBoundary() {\n * return boundary.error(useRouteError());\n * }\n * ```\n */\n error: errorBoundary,\n\n /**\n * A function that sets the appropriate document response headers.\n *\n * @example\n * <caption>Catching errors in a route</caption>\n * ```ts\n * // /app/routes/admin/widgets.ts\n * import { boundary } from \"@shopify/shopify-app-remix/server\";\n *\n * export const headers = (headersArgs) => {\n * return boundary.headers(headersArgs);\n * };\n * ```\n */\n headers: headersBoundary,\n};\n"],"names":[],"mappings":";;;AAGA;;AAEG;AACI,MAAM,QAAQ,GAAG;AACtB;;;;;;;;;;;;;AAaG;AACH,IAAA,KAAK,EAAE,aAAa;AAEpB;;;;;;;;;;;;;AAaG;AACH,IAAA,OAAO,EAAE,eAAe;;;;;"}