Hi Peter,
Thank you for your answer. There is no error message as such, to validate the Ad Text the code uses $this->session->setValidateOnly(true); first, then ApiException is caught and code adds exemption to operation by using $operation->setExemptionRequests([new ExemptionRequest($error->getKey())]) but in PHP library it only adds one exception to array, where 2 needed. So next step code executes mutate() with $this->session->setValidateOnly(false); but it will not pass as PolicyViolationError will be thrown.
It it helps I have response object from the library error handling:
Google\AdsApi\AdWords\v201708\cm\PolicyViolationError Object ( [key:protected] => Google\AdsApi\AdWords\v201708\cm\PolicyViolationKey Object ( [policyName:protected] => tobacco [violatingText:protected] => cigarettes ) [externalPolicyName:protected] => Tobacco and Cigarettes [externalPolicyUrl:protected] => [externalPolicyDescription:protected] => Google does not permit the advertisement of tobacco and tobacco-related products. Please see our full policy. [isExemptable:protected] => 1 [violatingParts:protected] => Array ( [0] => Google\AdsApi\AdWords\v201708\cm\PolicyViolationErrorPart Object ( [index:protected] => 0 [length:protected] => 10 ) ) [fieldPath:protected] => operations[0].operand.ad.finalUrls [fieldPathElements:protected] => Array ( [0] => Google\AdsApi\AdWords\v201708\cm\FieldPathElement Object ( [field:protected] => operations [index:protected] => 0 ) [1] => Google\AdsApi\AdWords\v201708\cm\FieldPathElement Object ( [field:protected] => operand [index:protected] => ) [2] => Google\AdsApi\AdWords\v201708\cm\FieldPathElement Object ( [field:protected] => ad [index:protected] => ) [3] => Google\AdsApi\AdWords\v201708\cm\FieldPathElement Object ( [field:protected] => finalUrls [index:protected] => ) ) [trigger:protected] => [errorString:protected] => PolicyViolationError.POLICY_ERROR [ApiErrorType:protected] => PolicyViolationError [parameterMap:Google\AdsApi\AdWords\v201708\cm\ApiError:private] => Array ( [ApiError.Type] => ApiErrorType ) )
I'm unable to use out of the library code as a whole project is deeply integrated with PHP Library methods.
Thanks.