1111use Utopia \Domains \Registrar \Exception \InvalidContactException ;
1212use Utopia \Domains \Registrar \Exception \AuthException ;
1313use Utopia \Domains \Registrar \Exception \PriceNotFoundException ;
14- use Utopia \Domains \Registrar \Exception \DomainNotAvailableException ;
14+ use Utopia \Domains \Registrar \Exception \DomainNotFoundException ;
1515use Utopia \Domains \Registrar \Adapter ;
1616use Utopia \Domains \Registrar \Renewal ;
1717use Utopia \Domains \Registrar \TransferStatus ;
@@ -334,9 +334,9 @@ public function getPrice(string $domain, int $periodYears = 1, string $regType =
334334 try {
335335 $ isAvailable = $ this ->available ($ domain );
336336 if (!$ isAvailable ) {
337- throw new DomainNotAvailableException ('Domain is not available: ' . $ domain , 400 );
337+ throw new DomainNotFoundException ('Domain is not available: ' . $ domain , 400 );
338338 }
339- } catch (DomainNotAvailableException $ e ) {
339+ } catch (DomainNotFoundException $ e ) {
340340 throw $ e ;
341341 } catch (Exception $ e ) {
342342 throw new DomainsException ('Failed to get price for domain: ' . $ e ->getMessage (), $ e ->getCode (), $ e );
@@ -527,7 +527,6 @@ public function getAuthCode(string $domain): string
527527 public function checkTransferStatus (string $ domain ): TransferStatus
528528 {
529529 try {
530- // Use efficient single-domain lookup endpoint
531530 $ result = $ this ->send ('GET ' , '/core/v1/transfers/ ' . $ domain );
532531
533532 $ status = $ this ->mapTransferStatus ($ result ['status ' ] ?? 'unknown ' );
@@ -539,13 +538,8 @@ public function checkTransferStatus(string $domain): TransferStatus
539538 timestamp: isset ($ result ['created ' ]) ? new DateTime ($ result ['created ' ]) : null ,
540539 );
541540 } catch (Exception $ e ) {
542- // If transfer not found (404), domain is transferable (no transfer initiated)
543541 if ($ e ->getCode () === 404 ) {
544- return new TransferStatus (
545- status: TransferStatusEnum::Transferrable,
546- reason: null ,
547- timestamp: null ,
548- );
542+ throw new DomainNotFoundException ('Domain not found: ' . $ domain , $ e ->getCode (), $ e );
549543 }
550544
551545 throw new DomainsException ('Failed to check transfer status: ' . $ e ->getMessage (), $ e ->getCode (), $ e );
0 commit comments