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
| Parameter | Type | Description |
|---|---|---|
campaignId | number | ID of the campaign that wasn't found |
response? | unknown | API response body if available |
requestId? | string | Correlation ID for debugging |
Returns
CampaignNotFoundError
Overrides
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
<a id="statuscode"></a> statusCode? | readonly | number | HTTP status code if applicable | WBAPIError.statusCode | errors/base-error.ts:25 |
<a id="response"></a> response? | readonly | unknown | API response body if available | WBAPIError.response | errors/base-error.ts:30 |
<a id="requestid"></a> requestId? | readonly | string | Correlation ID for debugging and tracing requests | WBAPIError.requestId | errors/base-error.ts:35 |
<a id="origin"></a> origin? | readonly | string | Origin service identifier from RFC 7807 problem+json responses. Indicates which internal Wildberries service originated the error (e.g., "s2s-api-auth-catalog"). | WBAPIError.origin | errors/base-error.ts:43 |
<a id="timestamp"></a> timestamp? | readonly | string | ISO 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.timestamp | errors/base-error.ts:51 |
<a id="campaignid"></a> campaignId | readonly | number | Campaign 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
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;
}| Name | Type | Defined in |
|---|---|---|
name | string | errors/promotion-errors.ts:68 |
message | string | errors/promotion-errors.ts:69 |
statusCode | number | errors/promotion-errors.ts:70 |
campaignId | number | errors/promotion-errors.ts:71 |
response? | unknown | errors/promotion-errors.ts:72 |
requestId? | string | errors/promotion-errors.ts:73 |