Add RouteNotFoundException
khalyomede opened this issue · comments
Khalyomede commented
Description
In the context of a router, the user can add a name to a route, and redirect the end user using a route name.
If this name is not found, I would like to raise a meaningful related exception.
Expected behavior
To be able to use RouteNotFoundException
as following:
use Folded\Exceptions\RouteNotFoundException;
try {
throw (new RouteNotFoundException("route foo not found"))->setRoute("foo");
} catch (RouteNotFoundException $exception) {
echo "route {$exception->getRoute()} not found";
}
Actual behavior
No exception related to route not found usable.
Alternatives solutions
I am using OutOfRangeException
for the moment.