Skip to content

Commit

Permalink
fix(payment): ensure that payment error is captured in logger
Browse files Browse the repository at this point in the history
  • Loading branch information
riqwan committed Dec 9, 2024
1 parent 866cabf commit dc1d834
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clever-experts-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/payment": patch
---

fix(payment): ensure that payment error is captured in logger
5 changes: 4 additions & 1 deletion packages/modules/payment/src/services/payment-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit dc1d834

Please sign in to comment.