mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-29 16:08:29 +03:00
15 lines
403 B
PHP
15 lines
403 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Core\Exception;
|
|
|
|
use Throwable;
|
|
|
|
class InvalidUrlException extends RuntimeException
|
|
{
|
|
public static function fromUrl($url, Throwable $previous = null)
|
|
{
|
|
$code = isset($previous) ? $previous->getCode() : -1;
|
|
return new static(sprintf('Provided URL "%s" is not an existing and valid URL', $url), $code, $previous);
|
|
}
|
|
}
|