fix(payment): ensure that payment error is captured in logger (#10506)

what:

- when an error occurs upon retrieving a provider, log the original error through the logger

Helps https://github.com/medusajs/medusa/issues/10500 in debugging.
This commit is contained in:
Riqwan Thamir
2024-12-09 16:44:32 +00:00
committed by GitHub
parent f8f5d57c7c
commit a04238a7f1
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/payment": patch
---
fix(payment): ensure that payment error is captured in logger
@@ -47,7 +47,10 @@ export default class PaymentProviderService extends ModulesSdkUtils.MedusaIntern
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.
`
this.#logger.error(errMessage)
// Ensure that the logger captures the actual error
this.#logger.error(e)
throw new Error(errMessage)
}
}