From 74f86c95b1cb90c519beff600c0b7f69a3d70ba1 Mon Sep 17 00:00:00 2001 From: Trevor <44841876+trevster344@users.noreply.github.com> Date: Tue, 22 Jul 2025 03:44:17 -0500 Subject: [PATCH] chore: Expose Awilix resolution errors (#13008) Co-authored-by: Trevor N. Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> --- packages/modules/auth/src/services/auth-provider.ts | 4 ++++ .../modules/fulfillment/src/services/fulfillment-provider.ts | 4 ++++ packages/modules/locking/src/services/locking-provider.ts | 4 ++++ .../notification/src/services/notification-provider.ts | 4 ++++ packages/modules/payment/src/services/payment-provider.ts | 4 ++++ packages/modules/tax/src/services/tax-provider.ts | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/packages/modules/auth/src/services/auth-provider.ts b/packages/modules/auth/src/services/auth-provider.ts index f919faba84..5dff91bdde 100644 --- a/packages/modules/auth/src/services/auth-provider.ts +++ b/packages/modules/auth/src/services/auth-provider.ts @@ -35,6 +35,10 @@ export default class AuthProviderService { const errMessage = ` Unable to retrieve the auth provider with id: ${providerId} Please make sure that the provider is registered in the container and it is configured correctly in your project configuration file.` + + // Log full error for debugging + this.#logger.error(`AwilixResolutionError: ${err.message}`, err) + throw new Error(errMessage) } diff --git a/packages/modules/fulfillment/src/services/fulfillment-provider.ts b/packages/modules/fulfillment/src/services/fulfillment-provider.ts index 104410fc25..c10b16b05a 100644 --- a/packages/modules/fulfillment/src/services/fulfillment-provider.ts +++ b/packages/modules/fulfillment/src/services/fulfillment-provider.ts @@ -66,6 +66,10 @@ export default class FulfillmentProviderService extends ModulesSdkUtils.MedusaIn const errMessage = ` Unable to retrieve the fulfillment provider with id: ${providerId} Please make sure that the provider is registered in the container and it is configured correctly in your project configuration file.` + + // Log full error for debugging + this.#logger.error(`AwilixResolutionError: ${err.message}`, err) + throw new Error(errMessage) } diff --git a/packages/modules/locking/src/services/locking-provider.ts b/packages/modules/locking/src/services/locking-provider.ts index 75e972dc70..9287a4d8e6 100644 --- a/packages/modules/locking/src/services/locking-provider.ts +++ b/packages/modules/locking/src/services/locking-provider.ts @@ -44,6 +44,10 @@ export default class LockingProviderService { const errMessage = ` Unable to retrieve the locking provider with id: ${providerId} Please make sure that the provider is registered in the container and it is configured correctly in your project configuration file.` + + // Log full error for debugging + this.#logger.error(`AwilixResolutionError: ${err.message}`, err) + throw new Error(errMessage) } diff --git a/packages/modules/notification/src/services/notification-provider.ts b/packages/modules/notification/src/services/notification-provider.ts index 54ae334856..0a0497b2d6 100644 --- a/packages/modules/notification/src/services/notification-provider.ts +++ b/packages/modules/notification/src/services/notification-provider.ts @@ -58,6 +58,10 @@ export default class NotificationProviderService extends ModulesSdkUtils.MedusaI const errMessage = ` Unable to retrieve the notification provider with id: ${providerId} Please make sure that the provider is registered in the container and it is configured correctly in your project configuration file.` + + // Log full error for debugging + this.#logger.error(`AwilixResolutionError: ${err.message}`, err) + throw new Error(errMessage) } diff --git a/packages/modules/payment/src/services/payment-provider.ts b/packages/modules/payment/src/services/payment-provider.ts index d70416deca..48402ddcb9 100644 --- a/packages/modules/payment/src/services/payment-provider.ts +++ b/packages/modules/payment/src/services/payment-provider.ts @@ -60,6 +60,10 @@ export default class PaymentProviderService extends ModulesSdkUtils.MedusaIntern const errMessage = ` Unable to retrieve the payment provider with id: ${providerId} Please make sure that the provider is registered in the container and it is configured correctly in your project configuration file.` + + // Log full error for debugging + this.#logger.error(`AwilixResolutionError: ${err.message}`, err) + throw new Error(errMessage) } diff --git a/packages/modules/tax/src/services/tax-provider.ts b/packages/modules/tax/src/services/tax-provider.ts index 51deb0624a..cbc38f1f92 100644 --- a/packages/modules/tax/src/services/tax-provider.ts +++ b/packages/modules/tax/src/services/tax-provider.ts @@ -29,6 +29,10 @@ export default class TaxProviderService extends ModulesSdkUtils.MedusaInternalSe const errMessage = ` Unable to retrieve the tax provider with id: ${providerId} Please make sure that the provider is registered in the container and it is configured correctly in your project configuration file.` + + // Log full error for debugging + this.#logger.error(`AwilixResolutionError: ${err.message}`, err) + throw new Error(errMessage) }