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

Improve error messages #37

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

yanisurbis
Copy link

@yanisurbis yanisurbis commented Jul 7, 2023

Problem statement:

  • if during an initialization a module throws an error it's hard to understand what module produced this error
  • the error, in this case, is creator is not a constructor (because of how error handling is done in Container.createInstance function)

This PR attempts to fix this problem by introducing a function that helps to distinguish between classes and function so we avoid swallowing the error during a module initialization.

  • we added tests for that
  • we also updated typescript, jest and ts-jest because { cause: e } is not supported in older TS versions

@vercel
Copy link

vercel bot commented Jul 7, 2023

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

Name Status Preview Comments Updated (UTC)
brandi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 7, 2023 11:36am

@acron0
Copy link

acron0 commented Jul 7, 2023

This suffers from #35, which is fixed in #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants