Skip to content

Commit

Permalink
Merge pull request #158 from ppi/tests-dispatch
Browse files Browse the repository at this point in the history
Additional error handling for invalid modules
  • Loading branch information
dragoonis committed Feb 7, 2016
2 parents f2388cc + 50c2186 commit 6ef30b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Module/Controller/ControllerNameParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ private function getPartsFromControllerName($controller)
list($moduleName, $controller, $action) = $parts;
$controller = str_replace('/', '\\', $controller);
$module = $this->moduleManager->getModule($moduleName);

if (!is_object($module)) {
throw new \RuntimeException(sprintf(
'Unable to locate module: %s, when parsing controller: %s',
$moduleName, $controller
));
}

$moduleName = $module->getName();

return [$module, $moduleName, $controller, $action];
Expand Down

0 comments on commit 6ef30b9

Please sign in to comment.