File tree Expand file tree Collapse file tree
blueprints-integration/src/api Expand file tree Collapse file tree 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 @@ -240,10 +240,12 @@ export async function executeActionInner(
240240 ) } (${ actionParameters . triggerMode } )`
241241 )
242242
243+ let result : ExecuteActionResult | void
244+
243245 try {
244246 const blueprintPersistentState = new PersistentPlayoutStateStore ( playoutModel . playlist . previousPersistentState )
245247
246- await blueprint . blueprint . executeAction (
248+ result = await blueprint . blueprint . executeAction (
247249 actionContext ,
248250 blueprintPersistentState ,
249251 actionParameters . actionId ,
@@ -262,6 +264,17 @@ export async function executeActionInner(
262264 throw UserError . fromUnknown ( err )
263265 }
264266
267+ if ( result && result . validationErrors ) {
268+ throw UserError . from (
269+ new Error (
270+ `AdLib Action "${ actionParameters . actionId } " validation failed: ${ JSON . stringify ( result . validationErrors ) } `
271+ ) ,
272+ UserErrorMessage . ValidationFailed ,
273+ undefined ,
274+ 409
275+ )
276+ }
277+
265278 // Store any notes generated by the action
266279 storeNotificationsForCategory (
267280 playoutModel ,
You can’t perform that action at this time.
0 commit comments