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);
}Related
RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartNotFoundError CartProviderError CartUserError CartAdapter CartEventBus
MetadataOpen in GitHub ↗
CartCapabilityUnsupportedError
Thrown by the kernel when a mutation requires a capability the active adapter doesn't advertise (e.g. gift cards on a provider without them).
CartEventBus
Inprocess pub/sub channel through which the kernel broadcasts cart lifecycle events. Returned by ; passed to internally and exposed on the returned via its on m