Skip to content

Wildberries API TypeScript SDK / RateLimitError

Class: RateLimitError ​

Defined in: errors/rate-limit-error.ts:25

Rate limit error thrown when API rate limits are exceeded.

This error is thrown for 429 Too Many Requests responses. The SDK's RetryHandler automatically retries rate-limited requests after the specified delay, so consumers typically don't need to handle this error manually.

Example ​

typescript
import { RateLimitError } from 'daytona-wildberries-typescript-sdk';

try {
  await sdk.products.createProduct(data);
} catch (error) {
  if (error instanceof RateLimitError) {
    console.log(`Rate limited. SDK will retry after ${error.retryAfter}ms`);
    // The SDK automatically retries, so you usually don't need to do anything
  }
}

Extends ​

Constructors ​

Constructor ​

ts
new RateLimitError(
   message: string, 
   retryAfter: number, 
   response?: unknown, 
   requestId?: string, 
   origin?: string, 
   timestamp?: string): RateLimitError;

Defined in: errors/rate-limit-error.ts:41

Creates a rate limit error

Parameters ​

ParameterTypeDefault valueDescription
messagestring'Rate limit exceeded. The SDK will automatically retry this request.'Error message (defaults to standard rate limit message)
retryAfternumberundefinedMilliseconds until retry is allowed
response?unknownundefinedAPI response body if available
requestId?stringundefinedCorrelation ID for debugging
origin?stringundefinedOrigin service identifier from RFC 7807 responses
timestamp?stringundefinedISO 8601 timestamp from RFC 7807 responses

Returns ​

RateLimitError

Overrides ​

WBAPIError.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
statusCode?readonlynumberHTTP status code if applicableWBAPIError.statusCodeerrors/base-error.ts:25
response?readonlyunknownAPI response body if availableWBAPIError.responseerrors/base-error.ts:30
requestId?readonlystringCorrelation ID for debugging and tracing requestsWBAPIError.requestIderrors/base-error.ts:35
origin?readonlystringOrigin service identifier from RFC 7807 problem+json responses. Indicates which internal Wildberries service originated the error (e.g., "s2s-api-auth-catalog").WBAPIError.originerrors/base-error.ts:43
timestamp?readonlystringISO 8601 timestamp from RFC 7807 problem+json responses. Indicates when the error occurred on the server side (e.g., "2024-09-30T06:52:38Z").WBAPIError.timestamperrors/base-error.ts:51
retryAfterreadonlynumberMilliseconds to wait before retrying the request-errors/rate-limit-error.ts:29

Methods ​

getUserMessage() ​

ts
getUserMessage(): string;

Defined in: errors/rate-limit-error.ts:59

Returns user-friendly error message with retry timing information

Returns ​

string

Error message with retry delay and automatic handling notice

Overrides ​

WBAPIError.getUserMessage


toJSON() ​

ts
toJSON(): {
  name: string;
  message: string;
  statusCode: number;
  retryAfter: number;
  response?: unknown;
  requestId?: string;
};

Defined in: errors/rate-limit-error.ts:80

Custom JSON serialization to preserve retryAfter property

Returns ​

ts
{
  name: string;
  message: string;
  statusCode: number;
  retryAfter: number;
  response?: unknown;
  requestId?: string;
}

Object representation including retryAfter timing

NameTypeDefined in
namestringerrors/rate-limit-error.ts:81
messagestringerrors/rate-limit-error.ts:82
statusCodenumbererrors/rate-limit-error.ts:83
retryAfternumbererrors/rate-limit-error.ts:84
response?unknownerrors/rate-limit-error.ts:85
requestId?stringerrors/rate-limit-error.ts:86

Overrides ​

WBAPIError.toJSON

Made with ❤️ for the Wildberries developer community