28 lines
661 B
PHP
28 lines
661 B
PHP
<?php
|
|
|
|
namespace App\Framework\Router\Exception;
|
|
|
|
use App\Framework\Exception\FrameworkException;
|
|
use App\Framework\Http\Exception\HttpException;
|
|
use App\Framework\Http\Status;
|
|
|
|
class RouteNotFound extends FrameworkException implements HttpException
|
|
{
|
|
public Status $status {
|
|
get {
|
|
return Status::NOT_FOUND;
|
|
}
|
|
}
|
|
|
|
protected string $route;
|
|
|
|
public function __construct(string $route, ?\Throwable $previous = null, int $code = 0, array $context = [])
|
|
{
|
|
$this->route = $route;
|
|
$message = "Route not found: {$route}";
|
|
|
|
#$context
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
}
|