File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
meteor/server/api/blueprints Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,21 @@ import { stringifyError } from '@sofie-automation/shared-lib/dist/lib/stringifyE
66
77export function evalBlueprint ( blueprint : Pick < Blueprint , '_id' | 'name' | 'code' > ) : SomeBlueprintManifest {
88 const blueprintPath = `db:///blueprint/${ blueprint . name || blueprint . _id } -bundle.js`
9- const context = vm . createContext ( { } , { } )
9+ const context = vm . createContext ( { process : process } , { } )
1010 const script = new vm . Script (
1111 `__run_result = ${ blueprint . code }
1212__run_result || blueprint` ,
1313 {
1414 filename : blueprintPath ,
1515 }
1616 )
17- const entry = script . runInContext ( context )
17+
18+ let entry : any
19+ try {
20+ entry = script . runInContext ( context )
21+ } catch ( e ) {
22+ console . error ( `Error evaluating Blueprint .runInContext "${ blueprint . _id } ": "${ stringifyError ( e ) } "` )
23+ }
1824
1925 const manifest : SomeBlueprintManifest = entry . default
2026
You can’t perform that action at this time.
0 commit comments