Skip to content

Feature/Added strict error handling when initializing modules.#22

Open
srgkr wants to merge 3 commits into
GenRockeR:mainfrom
srgkr:feature/module-validation
Open

Feature/Added strict error handling when initializing modules.#22
srgkr wants to merge 3 commits into
GenRockeR:mainfrom
srgkr:feature/module-validation

Conversation

@srgkr

@srgkr srgkr commented Feb 12, 2026

Copy link
Copy Markdown

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).

…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.
@GenRockeR

Copy link
Copy Markdown
Owner

Got it, merging this into the next release. Currently refactoring the library

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