Feature/Added strict error handling when initializing modules.#22
Open
srgkr wants to merge 3 commits into
Open
Feature/Added strict error handling when initializing modules.#22srgkr wants to merge 3 commits into
srgkr wants to merge 3 commits into
Conversation
…g if the module requires a missing component, fix: The health module can use the function API if the 'Knowledge Base' component is unavailable
This commit makes using modules more reliable and predictable. What's changed: - If a module (e.g., KB) lacks all required components to run, get_module now throws a RuntimeError instead of simply returning None. - Specifically for the EVENTS module: if storage_hostname is empty, it will now throw a ValueError to indicate a configuration issue. - If some of the module's functions (e.g., Health) require only one component (e.g., core, but not kb), get_module issues a warning. - An exception has been added to the Health module to handle connection issues with 'Knowledge Base'; functions that only use the API can be used.
Owner
|
Got it, merging this into the next release. Currently refactoring the library |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a problem with using the library when the MP account permissions are insufficient. It solves the connection crash (error 500) when Knowledge Base permissions are missing.
If the modules do not have all the required components to run, or if storage_hostname is empty for the EVENTS module, an exception is thrown depending on the type of error, RuntimeError or ValueError, to make it clear that the problem is in the configuration.
If only one of the components (for example, core, but not kb) is sufficient for some of the module's functions (for example, Health) to work, then get_module reports a warning and you can use some of the functions that do not require the missing component (for example, API functions in Health).