chore: Exception type

This commit is contained in:
Maël Gangloff
2024-08-30 12:54:42 +02:00
parent ceea587585
commit 01a0f8e688
9 changed files with 16 additions and 12 deletions

View File

@@ -29,12 +29,12 @@ class GandiProvider extends AbstractProvider
public function orderDomain(Domain $domain, bool $dryRun = false): void
{
if (!$domain->getDeleted()) {
throw new \Exception('The domain name still appears in the WHOIS database');
throw new \InvalidArgumentException('The domain name still appears in the WHOIS database');
}
$ldhName = $domain->getLdhName();
if (!$ldhName) {
throw new \Exception('Domain name cannot be null');
throw new \InvalidArgumentException('Domain name cannot be null');
}
$authData = self::verifyAuthData($this->authData, $this->client);

View File

@@ -49,12 +49,12 @@ class OvhProvider extends AbstractProvider
public function orderDomain(Domain $domain, bool $dryRun = false): void
{
if (!$domain->getDeleted()) {
throw new \Exception('The domain name still appears in the WHOIS database');
throw new \InvalidArgumentException('The domain name still appears in the WHOIS database');
}
$ldhName = $domain->getLdhName();
if (!$ldhName) {
throw new \Exception('Domain name cannot be null');
throw new \InvalidArgumentException('Domain name cannot be null');
}
$authData = self::verifyAuthData($this->authData, $this->client);
@@ -91,7 +91,7 @@ class OvhProvider extends AbstractProvider
);
if (empty($offer)) {
$conn->delete("/order/cart/{$cartId}");
throw new \Exception('Cannot buy this domain name');
throw new \InvalidArgumentException('Cannot buy this domain name');
}
$item = $conn->post("/order/cart/{$cartId}/domain", [