Skip to main content

ShopiError

All SDK errors are instances of ShopiError. Use instanceof to catch them cleanly.

Status codes

Automatic retries

The SDK automatically retries 500, 502, 503, 504, and 429 responses up to 2 times with exponential backoff (300ms, then 600ms). You do not need to implement retry logic yourself. For 429 responses, the SDK reads the Retry-After header and waits the correct amount of time before retrying.

Timeout

Every request times out after 10 seconds by default. A timed-out request throws ShopiError with status: 408.

Full error handling example