Renamed InvalidShortCodeException to ShortCodeNotFoundException

This commit is contained in:
Alejandro Celaya
2019-11-24 23:11:25 +01:00
parent cdd36b6712
commit 2f1de4a162
24 changed files with 58 additions and 47 deletions

View File

@@ -13,7 +13,7 @@ use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
use Zend\Expressive\Router\Exception\RuntimeException;
use Zend\Expressive\Router\RouterInterface;
@@ -60,7 +60,7 @@ class QrCodeAction implements MiddlewareInterface
try {
$this->urlShortener->shortCodeToUrl($shortCode, $domain);
} catch (InvalidShortCodeException | EntityDoesNotExistException $e) {
} catch (ShortUrlNotFoundException | EntityDoesNotExistException $e) {
$this->logger->warning('An error occurred while creating QR code. {e}', ['e' => $e]);
return $handler->handle($request);
}