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

GetPluginFiles method must not throw InvalidOperationException #7

Closed
MrDave1999 opened this issue Nov 14, 2023 · 0 comments · Fixed by #9
Closed

GetPluginFiles method must not throw InvalidOperationException #7

MrDave1999 opened this issue Nov 14, 2023 · 0 comments · Fixed by #9
Labels
breaking change A change in one part of a software that potentially causes other components to fail bug Something isn't working

Comments

@MrDave1999
Copy link
Owner

Implementations:

This exception occurs when the Plugins key does not exist in a configuration file as a json or .env.
This behavior should be changed for two reasons:

  • Violates the Principle of least astonishment. If the consumer does not want to load any plugins, then it should delete the configuration key, i.e. the Plugins key found in a configuration file and that's it.
    The expected behavior for the consumer is that no plugin is loaded, but the opposite happens: an exception is thrown.
    This surprises the consumer.
  • As the consumer has been surprised, then should create the configuration key with an empty value. However, if the consumer uses a .json file as source, an exception will still be thrown if an empty array appears in the Plugins section.
    See issue Cannot specify an empty array in the Plugins section of appsettings.json #6

If the consumer forgets to add the Plugins key in the configuration file, then the expected behavior is that no plugins are loaded. This is not a bug.

@MrDave1999 MrDave1999 added breaking change A change in one part of a software that potentially causes other components to fail bug Something isn't working labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change A change in one part of a software that potentially causes other components to fail bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant