chore(modules-sdk): Log full error when a loader fail to run (#12584)

* chore(modules-sdk): Log full error when a loader fail to run

* Create blue-ties-bow.md
This commit is contained in:
Adrien de Peretti
2025-05-22 16:54:09 +02:00
committed by GitHub
parent 1e7ce4af10
commit da5e278a78
2 changed files with 12 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import {
MedusaModuleType,
Modules,
ModulesSdkUtils,
stringifyCircular,
toMikroOrmEntities,
} from "@medusajs/utils"
import { asFunction, asValue } from "awilix"
@@ -665,6 +666,12 @@ async function runLoaders(
[keyName]: asValue(undefined),
})
logger.error(
`Loaders for module ${
resolution.definition.label
} failed with the following error: \n${stringifyCircular(err)}`
)
return {
error: new Error(
`Loaders for module ${resolution.definition.label} failed: ${err.message}`