Moved WrongIpException to IpGeolocation module

This commit is contained in:
Alejandro Celaya
2019-08-10 23:26:39 +02:00
parent 4aed8e6b59
commit 53243d1764
19 changed files with 34 additions and 26 deletions

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\IpGeolocation\Exception;
use Throwable;
interface ExceptionInterface extends Throwable
{
}

View File

@@ -0,0 +1,17 @@
<?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);
}
}