mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
31 lines
679 B
PHP
31 lines
679 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\CLI\Exception;
|
|
|
|
use RuntimeException;
|
|
use Throwable;
|
|
|
|
class GeolocationDbUpdateFailedException extends RuntimeException implements ExceptionInterface
|
|
{
|
|
private bool $olderDbExists;
|
|
|
|
public static function create(bool $olderDbExists, ?Throwable $prev = null): self
|
|
{
|
|
$e = new self(
|
|
'An error occurred while updating geolocation database, and an older version could not be found',
|
|
0,
|
|
$prev,
|
|
);
|
|
$e->olderDbExists = $olderDbExists;
|
|
|
|
return $e;
|
|
}
|
|
|
|
public function olderDbExists(): bool
|
|
{
|
|
return $this->olderDbExists;
|
|
}
|
|
}
|