yikart/AiToEarn · error · AppException
ChannelPublishPlatformNotSupported
ChannelPublishPlatformNotSupported
Error message
ChannelPublishPlatformNotSupported
What it means
getPublish resolves the platform's PublishProvider. The platform is registered but integration.publish is undefined, meaning the platform does not support publishing content through this system, so it throws ChannelPublishPlatformNotSupported with the platform in the details. Note that unlike getAuth/getPublish, a registered platform must have at least one capability, just not necessarily publish.
Source
Thrown at project/aitoearn-backend/apps/aitoearn-server/src/core/channels/platforms/platforms.registry.ts:79
throw new AppException(ResponseCode.PlatformNotSupported, { platform })
}
return registeredPlatform.integration
}
getAuth(platform: AccountType): AuthProvider {
const integration = this.get(platform)
if (!integration.auth) {
this.logger.warn({ platform }, 'Platform does not support auth')
throw new AppException(ResponseCode.PlatformNotSupported, { platform, capability: 'auth' })
}
return integration.auth
}
getPublish(platform: AccountType): PublishProvider {
const integration = this.get(platform)
if (!integration.publish) {
this.logger.warn({ platform }, 'Platform does not support publish')
throw new AppException(ResponseCode.ChannelPublishPlatformNotSupported, { platform })
}
return integration.publish
}
getPublishOptions(platform: AccountType): PublishOptionSourceProvider | undefined {
const integration = this.get(platform)
return integration.publishOptions
}
getAnalytics(platform: AccountType): AnalyticsProvider | undefined {
const integration = this.get(platform)
return integration.analytics
}
getEngagement(platform: AccountType): EngagementProvider | undefined {
const integration = this.get(platform)
return integration.engagement
}View on GitHub (pinned to d3aa8bea5b)
Solutions
- Check capabilities.publish.supported in the platform metadata before scheduling or dispatching a publish, and filter account lists accordingly.
- Restrict publish target selection in the UI to accounts whose platform declares publish support.
- If the platform should be publishable, implement and register a PublishProvider (integration.publish plus metadata.publishPolicy).
- Handle this code in publish pipelines by skipping (not retrying) the account and reporting it as unpublishable.
Example fix
// before
for (const account of accounts) {
await publishService.publish(account.id, payload) // throws for non-publish platforms
}
// after
for (const account of accounts.filter(a => capabilities[a.type]?.publish.supported)) {
await publishService.publish(account.id, payload)
} Defensive patterns
Strategy: validation
Validate before calling
const meta = registry.listMetadata().find(m => m.platform === platform)
if (!meta?.capabilities.publish.supported) {
throw new BadRequestException(`${platform} cannot publish content`)
} Type guard
function supportsPublish(integration: PlatformIntegration): integration is PlatformIntegration & { publish: PublishProvider } {
return Boolean(integration.publish)
} Try / catch
try {
await publishService.publish(accountId, payload)
} catch (e) {
if (e instanceof AppException && e.code === ResponseCode.ChannelPublishPlatformNotSupported) {
logger.warn(`Skipping publish for non-publishing platform ${e.details.platform}`)
return { skipped: true }
}
throw e
} Prevention
- Filter account/publish-target lists by capabilities.publish.supported.
- Never iterate all connected accounts with publish jobs unconditionally.
- Surface 'publishing unavailable' in the UI instead of a generic error.
- Check publishPolicy along with the publish provider when registering integrations.
When it happens
Trigger: Calling publish-related endpoints (create post, getPublishOptions flows, publish task dispatch) for a platform whose integration provides only e.g. analytics, engagement, browse, or webhook capabilities and no publish provider.
Common situations: A scheduling UI that lists all connected accounts as publish targets; automated jobs that iterate over accounts and try to publish for each; platform capability changed (publish provider removed due to upstream API shutdown); publishing to a browse/analysis-only integration.
Related errors
- PlatformNotSupported
- ChannelPaginationDirectionNotSupported
- PlatformNotSupported
- ChannelPlatformOperationNotSupported
- ChannelWebhookNotSupported
AI-assisted analysis of yikart/AiToEarn@d3aa8bea5b (2026-08-31).
Data as JSON: /api/errors/b78d40c39fdf2b6f.
Report an issue: GitHub.