Home > widget-integration > CartErrorContext
CartErrorContext interface
Cart error context for debugging and logging
Provides additional context about errors for better debugging and error tracking in production.
Signature:
export interface CartErrorContext
Example
const errorContext: CartErrorContext = {
operation: 'addToCart',
item: { productId: '12345', quantity: 2 },
timestamp: Date.now(),
sessionId: 'session_abc123',
userAgent: navigator.userAgent
};
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
(Optional) Cart item or operation details | |||
|
string |
Cart operation that failed | ||
|
string |
(Optional) User session ID for tracking | ||
|
number |
(Optional) Error timestamp | ||
|
string |
(Optional) User agent for debugging |