Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(): Update module provider retrieval error message and type #10138

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Nov 18, 2024

Partially RESOLVES FRMW-2802

What
Improve error message and change the error type when retrieving a provider from a local container fail

Copy link

changeset-bot bot commented Nov 18, 2024

🦋 Changeset detected

Latest commit: 8d96729

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 65 packages
Name Type
@medusajs/auth Patch
@medusajs/fulfillment Patch
@medusajs/locking Patch
@medusajs/notification Patch
@medusajs/payment Patch
integration-tests-http Patch
@medusajs/medusa Patch
@medusajs/test-utils Patch
@medusajs/api-key Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/cart Patch
@medusajs/currency Patch
@medusajs/customer Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/file Patch
@medusajs/index Patch
@medusajs/inventory Patch
@medusajs/link-modules Patch
@medusajs/order Patch
@medusajs/pricing Patch
@medusajs/product Patch
@medusajs/promotion Patch
@medusajs/region Patch
@medusajs/sales-channel Patch
@medusajs/stock-location Patch
@medusajs/store Patch
@medusajs/tax Patch
@medusajs/user Patch
@medusajs/workflow-engine-inmemory Patch
@medusajs/workflow-engine-redis Patch
@medusajs/auth-emailpass Patch
@medusajs/auth-github Patch
@medusajs/auth-google Patch
@medusajs/file-local Patch
@medusajs/file-s3 Patch
@medusajs/fulfillment-manual Patch
@medusajs/locking-postgres Patch
@medusajs/locking-redis Patch
@medusajs/notification-local Patch
@medusajs/notification-sendgrid Patch
@medusajs/payment-stripe Patch
@medusajs/core-flows Patch
@medusajs/framework Patch
@medusajs/js-sdk Patch
@medusajs/modules-sdk Patch
@medusajs/orchestration Patch
@medusajs/types Patch
@medusajs/utils Patch
@medusajs/workflows-sdk Patch
@medusajs/cli Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci Patch
@medusajs/telemetry Patch
@medusajs/admin-bundler Patch
@medusajs/admin-sdk Patch
@medusajs/admin-shared Patch
@medusajs/admin-vite-plugin Patch
@medusajs/dashboard Patch
@medusajs/icons Patch
@medusajs/toolbox Patch
@medusajs/ui-preset Patch
create-medusa-app Patch
medusa-dev-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 10:03am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Nov 19, 2024 10:03am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Nov 19, 2024 10:03am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Nov 19, 2024 10:03am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Nov 19, 2024 10:03am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Nov 19, 2024 10:03am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Nov 19, 2024 10:03am

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we log the error message?

@adrien2p
Copy link
Member Author

Should we log the error message?

Is there a reason why we would want to log it and throw it? the throw should appear in the log no?

@olivermrbl
Copy link
Contributor

olivermrbl commented Nov 18, 2024

Is there a reason why we would want to log it and throw it? the throw should appear in the log no?

@adrien2p, maybe I am missing something, but we are, in fact, not surfacing the actual error message, right? Only the description of what might have gone wrong (which I still think we should do).

} catch (err) {
  logger.debug(err) // <---- wouldn't this make it easier for developers to dig out the issue?
  const errMessage = "..."
  throw Error(errMessage)
}

For example, this would show if you are trying to consume the event bus service without having specified it in dependencies.

@adrien2p
Copy link
Member Author

Is there a reason why we would want to log it and throw it? the throw should appear in the log no?

@adrien2p, maybe I am missing something, but we are, in fact, not surfacing the actual error message, right? Only the description of what might have gone wrong (which I still think we should do).


} catch (err) {

  logger.debug(err) // <---- wouldn't this make it easier for developers to dig out the issue?

  const errMessage = "..."

  throw Error(errMessage)

}

For example, this would show if you are trying to consume the event bus service without having specified it in dependencies.

I could add it to the cause in fact? Cause you will have to stack trace and two errors if we both logs and throw. What i can do is log it for now and we can revisit our log/cause strategy in the appropriate project 🫡

@kodiakhq kodiakhq bot merged commit 7aa9907 into develop Nov 19, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants