ApiErrorDetail
Interface
One entry of an API error body, found in LynkowError.details. On a
validation error, each entry describes one invalid field.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | The API's stable error code for this entry, independent of the message.<br>The first entry carrying one is also |
|
| Yes | Request field the entry is about, on a validation error. Use it to show<br>the message next to the form field. |
|
| No | Readable English message, for logs or display. |
|
| Yes | Subscription context. Storefront responses never carry it. |
ErrorCode
TypeAlias
The code of a LynkowError, derived from the HTTP status (error.status).
For the API's precise reason, read error.apiCode. A few methods throw
NOT_FOUND before sending anything, for a slug that cannot name a resource.
Code | Status | When |
|---|---|---|
| 400 | Malformed request, such as a site ID that is not a UUID |
| 401 | Missing or invalid publishable key or buyer session |
| 402 | The site's subscription blocks the operation |
| 403 | Refused, such as a request from another domain |
| 404 | Unknown or unpublished resource |
| 409 | The resource changed or already exists |
| 422 | Invalid input, detailed per field in |
| 429 | Rate limited, after the SDK's retries on reads |
| 503 | API temporarily unavailable, after retries |
| 500 and others | Any other failing status |
| 0 | No response: offline, DNS failure or aborted request |
The SDK's services never throw RATE_LIMITED, TIMEOUT or UNKNOWN: only
LynkowError.fromResponse and LynkowError.fromNetworkError
build them.
type ErrorCode = "BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "RATE_LIMITED" | "TOO_MANY_REQUESTS" | "TIMEOUT" | "NETWORK_ERROR" | "INTERNAL_ERROR" | "SERVICE_UNAVAILABLE" | "UNKNOWN"SubscriptionErrorMeta
Interface
Subscription quota context of an API error. Storefront responses never carry it.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Current measured usage for the quota, when it is safe to disclose. |
|
| Yes | Configured quota ceiling, or |
|
| Yes | Subscription quota that rejected the operation, when quota enforcement applies. |
|
| Yes | Lowest plan slug that supports the requested capacity or feature. |