Making ClientExceptions turn into ClientErrorAction

Got some 404s which were presented as 500
This commit is contained in:
Mikael Nordfeldth
2016-01-14 02:47:28 +01:00
parent 99261e0781
commit 6834f355f2
3 changed files with 16 additions and 32 deletions

View File

@@ -1094,14 +1094,12 @@ class Router
function map($path)
{
try {
$match = $this->m->match($path);
} catch (Exception $e) {
common_debug('Problem getting route for '._ve($path).' - '._ve($e->getMessage()));
return $this->m->match($path);
} catch (NoRouteMapException $e) {
common_debug($e->getMessage());
// TRANS: Client error on action trying to visit a non-existing page.
throw new ClientException(_('Page not found.'), 404);
}
return $match;
}
function build($action, $args=null, $params=null, $fragment=null)