Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion meteor/server/api/blueprints/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ __run_result || blueprint`,
filename: blueprintPath,
}
)
const entry = script.runInContext(context)

let entry: any
try {
entry = script.runInContext(context)
} catch (e) {
logger.error(`Error evaluating Blueprint .runInContext "${blueprint._id}": "${stringifyError(e)}"`)
Copy link
Member

@Julusian Julusian Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to throw something still, otherwise it will throw an error on line 25 as it cant read property 'default' on undefined

I wonder if the handling is corect to have here, or if it should be the existing try/catch around the one usage of this that we care about this error from where it needs some better handling of the error, the one where it throws throw new Meteor.Error(400, `Blueprint ${blueprintId} failed to parse`)

While there may be value in having the try/catch at this level, we currently assume that once blueprints are stored in the db they will be sane and always parsable, which this wont change but will make noisier in the logs if it happens. So I am unsure if it adds value

}

const manifest: SomeBlueprintManifest = entry.default

Expand Down
Loading