Skip to content

SDK API Reference / withComposableDispatchErrors

Function: withComposableDispatchErrors() ​

withComposableDispatchErrors<T>(kind, operation, options?): Promise<T>

Run a journey-route operation, translating the ways the server reports "this account is not enabled for composable journey dispatch" — CdpFeature.composable_journey_dispatch_enabled? false, which forces the controller to treat the request as a complete journey:

  • 404 on member actions (show/update/pause/resume/detail) — a composable journey id is not in the complete scope. Mapped by default, with the "may not be enabled" wording.
  • 500 on GET /entities/journeys?folder_id=<composable root folder> — folder.audience is nil for a composable folder and the journey-id lookup dereferences it. Opt in per call site via ComposableDispatchErrorOptions.serverErrorMeansDispatchDisabled: a 500 from any other journey route is a genuine fault, and mapping it everywhere told a user whose pause/run/resume hit a broken server to contact their CSM. GET /entities/by-folder/:folderId — behind journey list and name resolution — does not fail this way; validated live on a CAS-486-disabled account.

Applied only for kind === 'composable', so the complete path is untouched. The original error is kept as the cause for --debug.

Dormant: composable audiences are hidden from tdx journey (CAS-978), so kind is always complete at runtime today and every wrapper is a pass-through. Kept, with its tests, for the complete/composable consolidation — see sdk/segment/audience-context.ts's header.

Type Parameters ​

T ​

T

Parameters ​

kind ​

AudienceKind

operation ​

() => Promise<T>

options? ​

ComposableDispatchErrorOptions

Returns ​

Promise<T>