Files
shlink/module/Core/src/Exception/InvalidUrlException.php
T

15 lines
403 B
PHP
Raw Normal View History

<?php
2017-10-12 10:13:20 +02:00
declare(strict_types=1);
2016-07-19 18:01:39 +02:00
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;
2017-12-27 16:23:54 +01:00
return new static(sprintf('Provided URL "%s" is not an existing and valid URL', $url), $code, $previous);
}
}