Files
shlink/module/IpGeolocation/src/Exception/WrongIpException.php
2019-08-10 23:26:39 +02:00

18 lines
443 B
PHP

<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\IpGeolocation\Exception;
use Shlinkio\Shlink\Common\Exception\RuntimeException;
use Throwable;
use function sprintf;
class WrongIpException extends RuntimeException implements ExceptionInterface
{
public static function fromIpAddress($ipAddress, ?Throwable $prev = null): self
{
return new self(sprintf('Provided IP "%s" is invalid', $ipAddress), 0, $prev);
}
}