Skip to content
Snippets Groups Projects
Verified Commit 7d9521c6 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

fix: throw exception on failed load

parent 64a0769a
No related branches found
No related tags found
3 merge requests!3improve into wp-hook and some additional unfinished things,!21.x,!1Draft: Basic implementation of plugin initializer
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
......@@ -13,7 +13,12 @@ class PhpFileLoader {
public function load( string $resource ) {
// TODO: add file locator
return ( static function () use ( $resource ) {
return include $resource;
$data = include $resource;
if ( $data === false ) {
throw new \RuntimeException( "Could not load $resource" );
}
return $data;
} )();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment