Error

errors · /index·class

Base class for all structured commerce errors, providing a typed error code, HTTP status code, human-readable details, and a documentation help URL.

Subclasses set name, code, details, and description as class fields.

Signature

Example

class ProductNotFoundError extends Error<GenericErrorKind> {
    name = 'ProductNotFoundError';
    code = GenericErrorKind.NOT_FOUND;
    details = 'Product not found';
    description = 'No product exists for the given handle';
}
throw new ProductNotFoundError();

ApiErrorKind GenericErrorKind ApiError CartNotFoundError CartProviderError CartUserError ConvexOperatorTokenMintError DomainVerificationError

Sourceindex.ts:20Edit the JSDoc directly
Metadata@nordcom/commerce-errors@0.0.0Open in GitHub ↗

On this page