2016-04-17 11:29:23 +02:00
|
|
|
<?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;
|
2016-04-17 11:29:23 +02:00
|
|
|
|
2016-07-20 10:13:53 +02:00
|
|
|
use Shlinkio\Shlink\Common\Exception\RuntimeException;
|
|
|
|
|
|
2016-04-17 11:29:23 +02:00
|
|
|
class InvalidUrlException extends RuntimeException
|
|
|
|
|
{
|
|
|
|
|
public static function fromUrl($url, \Exception $previous = null)
|
|
|
|
|
{
|
|
|
|
|
$code = isset($previous) ? $previous->getCode() : -1;
|
|
|
|
|
return new static(sprintf('Provided URL "%s" is not an exisitng and valid URL', $url), $code, $previous);
|
|
|
|
|
}
|
|
|
|
|
}
|