diff --git a/kiri-engine/Scanner.php b/kiri-engine/Scanner.php index 04c8ff58..0612b11d 100644 --- a/kiri-engine/Scanner.php +++ b/kiri-engine/Scanner.php @@ -35,8 +35,9 @@ class Scanner extends Component $container = Container::instance(); foreach ($this->files as $file) { $class = $namespace . '\\' . $this->rename($file); - if (!file_exists($class)) { - throw new Exception('Please follow the PSR-4 specification to write code.' . $class); + if (file_exists($class)) { + error('Please follow the PSR-4 specification to write code.' . $class); + continue; } $container->parse($class); }