additional logging around component definitions

This commit is contained in:
Martin McKeaveney 2022-08-25 10:57:30 +01:00
parent e77e6b070f
commit d5c2f32df3
2 changed files with 27 additions and 22 deletions

View File

@ -3,6 +3,7 @@ const { getComponentLibraryManifest } = require("../../utilities/fileSystem")
const { getAppDB } = require("@budibase/backend-core/context") const { getAppDB } = require("@budibase/backend-core/context")
exports.fetchAppComponentDefinitions = async function (ctx) { exports.fetchAppComponentDefinitions = async function (ctx) {
try {
const db = getAppDB() const db = getAppDB()
const app = await db.get(DocumentType.APP_METADATA) const app = await db.get(DocumentType.APP_METADATA)
@ -31,4 +32,7 @@ exports.fetchAppComponentDefinitions = async function (ctx) {
} }
} }
ctx.body = definitions ctx.body = definitions
} catch (err) {
console.error(`component-definitions=failed`, err)
}
} }

View File

@ -291,6 +291,7 @@ exports.getComponentLibraryManifest = async library => {
const path = join(appId, filename) const path = join(appId, filename)
resp = await retrieve(ObjectStoreBuckets.APPS, path) resp = await retrieve(ObjectStoreBuckets.APPS, path)
} catch (error) { } catch (error) {
console.error(`component-manifest-objectstore=failed appId=${appId}`, error)
// Fallback to loading it from the old location for old apps // Fallback to loading it from the old location for old apps
const path = join(appId, "node_modules", library, "package", filename) const path = join(appId, "node_modules", library, "package", filename)
resp = await retrieve(ObjectStoreBuckets.APPS, path) resp = await retrieve(ObjectStoreBuckets.APPS, path)