Skip to content

Commit 69dabbf

Browse files
committed
handle price mismatch
1 parent 4512737 commit 69dabbf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Domains/Registrar/OpenSRS.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ public function cancelPurchase(): bool
237237
*/
238238
public function suggest(array|string $query, array $tlds = [], int|null $limit = null, int|null $priceMax = null, int|null $priceMin = null): array
239239
{
240+
if ($priceMin !== null && $priceMax !== null && $priceMin >= $priceMax) {
241+
throw new Exception("Invalid price range: priceMin ($priceMin) must be less than priceMax ($priceMax).");
242+
}
243+
240244
$query = is_array($query) ? $query : [$query];
241245
$message = [
242246
'object' => 'DOMAIN',

0 commit comments

Comments
 (0)