You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a provider can't be found, the error message received is incorrect, because there is an exception thrown during the error logging processes. Solution is to move the $className variable to a scope that can been seen in exception, such as before the try. See :todo below:
staticsynchronizedMap<String,Class<StorageProviderInterface>>loadProviders(ClassLoaderclassLoader=Thread.currentThread().contextClassLoader) {
if(providers ==null) {
def resources = classLoader.getResources(FACTORIES_RESOURCE_LOCATION)
providers = [:]
resources.each { URLres->Properties providerProperties =newProperties()
providerProperties.load(res.openStream())
providerProperties.keySet().each { providerName->try {
String className = providerProperties.getProperty(providerName)
def cls = classLoader.loadClass(className)
if(StorageProviderInterface.isAssignableFrom(cls)) {
if(!providers[providerName]) {
providers[providerName] = cls
}
} else {
log.warn("Karman Storage Provider $className not registered because it does not implement the StorageProviderInterface")
}
} catch(Throwable e) {
// TODO: make $className in higher scope so when provider can't be found, real error will log. Otherwise it will complain that $className can't be found.
log.error("Error Loading Karman Storage Provider $className: $e.message",e)
}
}
}
}
return providers
}
The text was updated successfully, but these errors were encountered:
If a provider can't be found, the error message received is incorrect, because there is an exception thrown during the error logging processes. Solution is to move the $className variable to a scope that can been seen in exception, such as before the try. See :todo below:
The text was updated successfully, but these errors were encountered: