Skip to content
Snippets Groups Projects
Commit 3d32ff6d authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

The data store can be a custom class in a module. When we cannot load a class...

The data store can be a custom class in a module. When we cannot load a class matching the 'store.type' configuration option we don't handle the exception, causing a fatal error. Use the new CriticalConfigurationError to fix that. This fixes #369.
parent deb9552c
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,17 @@ abstract class SimpleSAML_Store
break;
default:
// datastore from module
$className = SimpleSAML\Module::resolveClass($storeType, 'Store', 'SimpleSAML_Store');
try {
$className = SimpleSAML\Module::resolveClass($storeType, 'Store', 'SimpleSAML_Store');
} catch (Exception $e) {
$c = $config->toArray();
$c['store.type'] = 'phpsession';
throw new SimpleSAML\Error\CriticalConfigurationError(
"Invalid 'store.type' configuration option. Cannot find store '$storeType'.",
null,
$c
);
}
self::$instance = new $className();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment