CartError

cart · /core·class

Base class for every cart-core domain error. Consumers match on error.name rather than instanceof because cart-core errors can cross package boundaries (SSR → client, worker → main) where the constructor identity isn't preserved.

Signature

Example

try {
  await kernel.mutate(ctx, mutation);
} catch (err) {
  if ((err as CartError).name === 'CartError') console.error(err.message);
}

RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartNotFoundError CartProviderError CartUserError CartAdapter CartEventBus

Sourceerrors.ts:16Edit the JSDoc directly

On this page