You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a module which depends on gigya/drupal8 and I'm using the following API:
$responce = $helper->getGigyaApiHelper()->sendApiCall('accounts.unsubscribe', ['email' => '[email protected]']);
// validate $responce and do something else
This call is throwing the following error because there's no such email registered in Gigya and prevents my code to execute "validate $responce and do something else" part:
Drupal\gigya\CmsStarterKit\GSApiException: Invalid parameter value in Drupal\gigya\CmsStarterKit\GigyaAuthRequest->send() (line 49 of /Applications/MAMP/htdocs/di-tjx-ntw-d9/web/modules/contrib/gigya-drupal/gigya/src/CmsStarterKit/GigyaAuthRequest.php).
The error is the actual error response from Gigya, but it shouldn't block me from doing something else.
I believe the code of send() method should look something like this instead:
public function send($timeout = null) {
try {
$res = parent::send($timeout);
if ($res->getErrorCode() == 0)
{
return $res;
}
}
catch (Exception $e) {
if (!empty($res->getData())) { /* Actual error response from Gigya */
throw new GSApiException($res->getErrorMessage(), $res->getErrorCode(), $res->getResponseText(), $res->getString("callId", "N/A"));
} else { /* Hard-coded error in PHP SDK, or another failure */
throw new GSException($res->getErrorMessage(), $res->getErrorCode());
}
}
}
The text was updated successfully, but these errors were encountered:
I have created a module which depends on gigya/drupal8 and I'm using the following API:
This call is throwing the following error because there's no such email registered in Gigya and prevents my code to execute "validate $responce and do something else" part:
The error is the actual error response from Gigya, but it shouldn't block me from doing something else.
I believe the code of
send()
method should look something like this instead:The text was updated successfully, but these errors were encountered: