Skip to content

Wildberries API TypeScript SDK / CampaignNotFoundError

Class: CampaignNotFoundError

Defined in: errors/promotion-errors.ts:26

Error thrown when a campaign is not found by its ID.

This error typically occurs when:

  • Campaign was deleted
  • Campaign ID is incorrect
  • Campaign belongs to another seller account

Example

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

try {
  await sdk.promotion.startCampaign(123456);
} catch (error) {
  if (error instanceof CampaignNotFoundError) {
    console.error('Campaign does not exist:', error.message);
    // Verify campaign ID and try again
  }
}

Extends

Constructors

Constructor

ts
new CampaignNotFoundError(
   campaignId: number, 
   response?: unknown, 
   requestId?: string): CampaignNotFoundError;

Defined in: errors/promotion-errors.ts:39

Creates a CampaignNotFoundError

Parameters

ParameterTypeDescription
campaignIdnumberID of the campaign that wasn't found
response?unknownAPI response body if available
requestId?stringCorrelation ID for debugging

Returns

CampaignNotFoundError

Overrides

WBAPIError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
<a id="statuscode"></a> statusCode?readonlynumberHTTP status code if applicableWBAPIError.statusCodeerrors/base-error.ts:25
<a id="response"></a> response?readonlyunknownAPI response body if availableWBAPIError.responseerrors/base-error.ts:30
<a id="requestid"></a> requestId?readonlystringCorrelation ID for debugging and tracing requestsWBAPIError.requestIderrors/base-error.ts:35
<a id="origin"></a> 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
<a id="timestamp"></a> 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
<a id="campaignid"></a> campaignIdreadonlynumberCampaign ID that was not found-errors/promotion-errors.ts:30

Methods

getUserMessage()

ts
getUserMessage(): string;

Defined in: errors/promotion-errors.ts:50

Returns user-friendly error message with recovery guidance

Returns

string

Error message with actionable steps

Overrides

WBAPIError.getUserMessage


toJSON()

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

Defined in: errors/promotion-errors.ts:67

Custom JSON serialization

Returns

ts
{
  name: string;
  message: string;
  statusCode: number;
  campaignId: number;
  response?: unknown;
  requestId?: string;
}
NameTypeDefined in
namestringerrors/promotion-errors.ts:68
messagestringerrors/promotion-errors.ts:69
statusCodenumbererrors/promotion-errors.ts:70
campaignIdnumbererrors/promotion-errors.ts:71
response?unknownerrors/promotion-errors.ts:72
requestId?stringerrors/promotion-errors.ts:73

Overrides

WBAPIError.toJSON

Made with ❤️ for the Wildberries developer community