Skip to content

Commit 4843d3a

Browse files
committed
Return more information when bad blueprint upload happens
1 parent 831c538 commit 4843d3a

File tree

1 file changed

+7
-2
lines changed
  • meteor/server/api/blueprints

1 file changed

+7
-2
lines changed

meteor/server/api/blueprints/api.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { DBStudio } from '@sofie-automation/corelib/dist/dataModel/Studio'
3131
import { UserPermissions } from '@sofie-automation/meteor-lib/dist/userPermissions'
3232
import { assertConnectionHasOneOfPermissions, RequestCredentials } from '../../security/auth'
3333
import { blueprintsPerformDevelopmentMode } from './development'
34+
import { inspect } from 'util'
3435

3536
const PERMISSIONS_FOR_MANAGE_BLUEPRINTS: Array<keyof UserPermissions> = ['configure']
3637

@@ -174,8 +175,12 @@ async function innerUploadBlueprint(
174175
let blueprintManifest: SomeBlueprintManifest | undefined
175176
try {
176177
blueprintManifest = evalBlueprint(newBlueprint)
177-
} catch (_e) {
178-
throw new Meteor.Error(400, `Blueprint ${blueprintId} failed to parse`)
178+
} catch (error) {
179+
console.log('Parsing error:', error)
180+
throw new Meteor.Error(
181+
400,
182+
`Blueprint ${blueprintId} failed to parse; error: ${(error as Error).message}.\n${inspect(error, { depth: 5 })}`
183+
)
179184
}
180185

181186
if (!_.isObject(blueprintManifest))

0 commit comments

Comments
 (0)