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:
1 parent
1e7ce4af10
commit
da5e278a78
2 files changed
+12
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/modules-sdk": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
chore(modules-sdk): Log full error when a loader fail to run
|
||||||
@@ -24,6 +24,7 @@ import {
|
|||||||
MedusaModuleType,
|
MedusaModuleType,
|
||||||
Modules,
|
Modules,
|
||||||
ModulesSdkUtils,
|
ModulesSdkUtils,
|
||||||
|
stringifyCircular,
|
||||||
toMikroOrmEntities,
|
toMikroOrmEntities,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { asFunction, asValue } from "awilix"
|
import { asFunction, asValue } from "awilix"
|
||||||
@@ -665,6 +666,12 @@ async function runLoaders(
|
|||||||
[keyName]: asValue(undefined),
|
[keyName]: asValue(undefined),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger.error(
|
||||||
|
`Loaders for module ${
|
||||||
|
resolution.definition.label
|
||||||
|
} failed with the following error: \n${stringifyCircular(err)}`
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
error: new Error(
|
error: new Error(
|
||||||
`Loaders for module ${resolution.definition.label} failed: ${err.message}`
|
`Loaders for module ${resolution.definition.label} failed: ${err.message}`
|
||||||
|
|||||||
Reference in new issue
Block a user