Skip to content

Commit

Permalink
Merge pull request #99 from SynergyWholesale/feature/SW-2888-update-h…
Browse files Browse the repository at this point in the history
…andling-error-message-from-domain-info-request-for-whmcs-domain-module

feature/SW-2888-update-handling-error-message-from-domain-info-request-for-whmcs-domain-module
  • Loading branch information
Sn0wCrack authored Feb 21, 2024
2 parents 5004104 + 841a149 commit 8bc2945
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ function synergywholesaledomains_Sync(array $params)
->first();
// If the domain used to exist in this whmcs installation it's safe to say if we get these errors then
// it has been transferred away to another reseller
if ('Domain Info Failed - Unable to retrieve domain id' === $response['error']) {
if (in_array($response['error'], ['Domain Info Failed - Unable to retrieve domain id', 'Domain Info Failed - Domain Does Not Exist'])) {
// If now is after the domains expiry date mark it as cancelled
if (time() >= strtotime($selectInfo->expirydate)) {
$note = 'Domain has been marked as cancelled due to not being in your account and, the current date is past the expiry date';
Expand Down Expand Up @@ -1075,7 +1075,7 @@ function synergywholesaledomains_TransferSync(array $params)
try {
$response = synergywholesaledomains_apiRequest('domainInfo', $params);
} catch (\Exception $e) {
if ($e->getMessage() == 'Domain Info Failed - Unable to retrieve domain id') {
if (in_array($e->getMessage(), ['Domain Info Failed - Unable to retrieve domain id', 'Domain Info Failed - Domain Does Not Exist'])) {
return [
'completed' => false,
'failed' => true,
Expand Down

0 comments on commit 8bc2945

Please sign in to comment.