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 message for Unable to resolve service for type <TenantInfo> while attempting to activate... #837

Open
fdcastel opened this issue Jun 3, 2024 · 1 comment

Comments

@fdcastel
Copy link

fdcastel commented Jun 3, 2024

I'm having this problem now and it is surely a configuration problem. But the generic message isn't helpful pointing to where the problem is.

It seems several other issues (#799, #465, #340, #140) had the same problem.

More informative messages like

  • No tenant with id = "ACME" was found in the configured stores.
  • No MultiTenant Strategy registered. Please see https://www.finbuckle.com/MultiTenant/Docs/ConfigurationAndUsage
  • No MultiTenant Store registered. Please see https://www.finbuckle.com/MultiTenant/Docs/ConfigurationAndUsage
    and others would surely help.

This way, if we see the generic Unable to resolve service for type ... message again we could probable use this as a good indicator for "You forgot to call .Add/UseMultitenant()."

Also: #628 (related).

@AndrewTriesToCode
Copy link
Contributor

I like this idea. One reason I removed DI for TenantInfo was to eliminate one major cause of these exceptions and these errors messages would go further.

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

No branches or pull requests

2 participants