File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
blueprints-integration/src/api Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ export interface ShowStyleBlueprintManifest<
142142 privateData : unknown | undefined ,
143143 publicData : unknown | undefined ,
144144 actionOptions : { [ key : string ] : any } | undefined
145- ) => Promise < void >
145+ ) => Promise < { validationErrors : any } | void >
146146
147147 /** Generate adlib piece from ingest data */
148148 getAdlibItem ?: (
Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ export interface ExecuteBucketAdLibOrActionProps extends RundownPlayoutPropsBase
285285export interface ExecuteActionResult {
286286 queuedPartInstanceId ?: PartInstanceId
287287 taken ?: boolean
288+ validationErrors ?: any
288289}
289290export interface TakeNextPartProps extends RundownPlayoutPropsBase {
290291 fromPartInstanceId : PartInstanceId | null
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ export async function executeActionInner(
243243 try {
244244 const blueprintPersistentState = new PersistentPlayoutStateStore ( playoutModel . playlist . previousPersistentState )
245245
246- await blueprint . blueprint . executeAction (
246+ const result = await blueprint . blueprint . executeAction (
247247 actionContext ,
248248 blueprintPersistentState ,
249249 actionParameters . actionId ,
@@ -253,6 +253,14 @@ export async function executeActionInner(
253253 actionParameters . publicData ,
254254 actionParameters . actionOptions ?? { }
255255 )
256+ if ( result && result . validationErrors ) {
257+ throw UserError . from (
258+ new Error ( `AdLib Action validation failed: ${ JSON . stringify ( result . validationErrors ) } ` ) ,
259+ UserErrorMessage . ValidationFailed ,
260+ undefined ,
261+ 409
262+ )
263+ }
256264
257265 if ( blueprintPersistentState . hasChanges ) {
258266 playoutModel . setBlueprintPersistentState ( blueprintPersistentState . getAll ( ) )
You can’t perform that action at this time.
0 commit comments