mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 09:13:11 +08:00
Replaced the use of EntityDoesNotExistException by ShorturlNotFoundException where applicable
This commit is contained in:
@@ -19,11 +19,7 @@ class NonUniqueSlugException extends InvalidArgumentException implements Problem
|
||||
|
||||
public static function fromSlug(string $slug, ?string $domain): self
|
||||
{
|
||||
$suffix = '';
|
||||
if ($domain !== null) {
|
||||
$suffix = sprintf(' for domain "%s"', $domain);
|
||||
}
|
||||
|
||||
$suffix = $domain === null ? '' : sprintf(' for domain "%s"', $domain);
|
||||
$e = new self(sprintf('Provided slug "%s" is already in use%s.', $slug, $suffix));
|
||||
|
||||
$e->detail = $e->getMessage();
|
||||
|
||||
@@ -17,9 +17,10 @@ class ShortUrlNotFoundException extends DomainException implements ProblemDetail
|
||||
private const TITLE = 'Short URL not found';
|
||||
public const TYPE = 'INVALID_SHORTCODE';
|
||||
|
||||
public static function fromNotFoundShortCode(string $shortCode): self
|
||||
public static function fromNotFoundShortCode(string $shortCode, ?string $domain = null): self
|
||||
{
|
||||
$e = new self(sprintf('No URL found for short code "%s"', $shortCode));
|
||||
$suffix = $domain === null ? '' : sprintf(' for domain "%s"', $domain);
|
||||
$e = new self(sprintf('No URL found with short code "%s"%s', $shortCode, $suffix));
|
||||
|
||||
$e->detail = $e->getMessage();
|
||||
$e->title = self::TITLE;
|
||||
|
||||
Reference in New Issue
Block a user