getStatusCode()) { 404 => 'The route does not exist.', 405 => 'The HTTP method not allowed.', default => $throwable->getMessage(), }; $throwable = new ErrException($msg,ResultCode::ERROR); return $this->handlerResponse($throwable,$response); } return $response; } /** * @param Throwable $throwable * @return bool */ public function isValid(Throwable $throwable): bool { return $throwable instanceof HttpException; } }