add message to Dispatch exceptions (#1376)

Exceptions thrown while attempting to dispatch routes are now informing the exact value that was incorrect; url for not found routes and the method when the method was invalid.
This commit is contained in:
Marcel Pokrandt 2018-02-21 11:28:45 +01:00 committed by Daniël Klabbers
parent 7bfb220979
commit f5a4d7b2a3

View File

@ -59,9 +59,9 @@ class DispatchRoute
switch ($routeInfo[0]) {
case Dispatcher::NOT_FOUND:
throw new RouteNotFoundException;
throw new RouteNotFoundException($uri);
case Dispatcher::METHOD_NOT_ALLOWED:
throw new MethodNotAllowedException;
throw new MethodNotAllowedException($method);
case Dispatcher::FOUND:
$handler = $routeInfo[1];
$parameters = $routeInfo[2];