/** * Handle a not found route. * * @param \Psr\Http\Message\ResponseInterface $response * * @throws \League\Route\Http\Exception\NotFoundException if a response cannot be built * * @return \Psr\Http\Message\ResponseInterface */ protected function handleNotFound(ResponseInterface $response) { $exception = new NotFoundException(); if ($this->getStrategy() instanceof JsonStrategy) { return $exception->buildJsonResponse($response); } throw $exception; }
public function handleRouteNotFound() { // @todo add route not found view $exception = new NotFoundException(); if ($this->getStrategy() instanceof RestfulStrategy) { return $exception->getJsonResponse(); } throw $exception; }
/** * Handle a not found route * * @return \Symfony\Component\HttpFoundation\Response */ protected function handleNotFound() { $exception = new NotFoundException(); if ($this->getStrategy() instanceof RestfulStrategy) { return $exception->getJsonResponse(); } throw $exception; }