Closed infeo closed 9 months ago
The changes focus on enhancing the resilience of the IntegrationsLoader
in handling service loading failures. By refining the loading process, the updates ensure that an exception thrown by one service does not prevent the loading of others. This includes the introduction of a method for more robust service provider instantiation, improved error logging, and specific test cases to verify the behavior when exceptions are encountered.
File Path | Change Summary |
---|---|
.../common/IntegrationsLoader.java |
Added ServiceConfigurationError handling, new instantiateServiceProvider method, and improved error logging. |
.../common/IntegrationsLoaderTest.java |
Added tests for handling exceptions in @CheckAvailability methods. |
.../common/InitExceptionTestClass.java |
New file for testing initialization exceptions. |
Objective | Addressed | Explanation |
---|---|---|
Increase resilience against service loading failure (#26) | ✅ |
In the code where services dwell, A rabbit worked, casting its spell. With a hop and a leap, no error too steep, It weaved resilience, so deep.
"Fear not," it squeaked, with a twinkle in eye, "For your services, no longer will sigh. Through storms and errors, they'll stand tall, United we code, we'll never fall."
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes #26.
This PR improves discovery and loading of supported service providers by catching common exceptions/errors during this process (
ExceptionInInitializationError
,NoClassDefFoundError
,RuntimeException
).If one of those throwables are thrown, the service provider is considered as "not supported" and filtered out.
Summary by CodeRabbit