Hello,

If you are going to include automatic retry code, please do make sure that 
you use an exponential backoff in case you are accidentally retrying 
something that is never going to succeed. Even for a call that might 
eventually succeed, constantly hitting the server when there are server 
issues causing it to fail is counterproductive.

Thanks!
-Mike, AdWords API Team

On Thursday, November 20, 2014 4:42:10 AM UTC-5, Kristopher Windsor wrote:
>
> Thanks Michael and Oliver.
>
> I want the default to be "do retry," and I wrote this today (PHP):
>
>   public static function isRetriable($e){
>     if ($e instanceof SoapFault && @$e->detail->ApiExceptionFault->errors[
> 0]->enc_value instanceof ApiError){
>       $err = $e->detail->ApiExceptionFault->errors[0]->enc_value;
>       if ($err instanceof ApiError){
>         // ie CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY_CONFIGURATION
>         if ($err->ApiErrorType == 'AdGroupCriterionError')
>           return false;
>         // ie INVALID_FORMAT_FOR_PLACEMENT_URL
>         if ($err->ApiErrorType == 'CriterionError')
>           return false;
>       }
>     }
>     return true;
>   }
>
> I don't plan to handle all of the possible errors, just the ones I know we 
> waste time retrying.
>
> My main question is... should I be inspecting SoapFault this closely?
> It seems like it is tedious to find the actual instances of ApiError 
> within SoapFault.
>
> On Tuesday, November 18, 2014 1:35:34 PM UTC-8, Kristopher Windsor wrote:
>>
>> Hi,
>>
>> When the Adwords API throws an Exception, I'd like to know if I should 
>> retry (intermittent errors) or not (bad input on my end).
>> I am using the PHP client library.
>>
>> For example, I should retry for this case:
>> InternalApiError.UNEXPECTED_INTERNAL_API_ERROR
>>
>> But not for this case:
>> BiddingError.BID_TOO_MANY_FRACTIONAL_DIGITS
>>
>> Is there some way to determine if I should retry, other than just 
>> building a big list of retry-able / non-retry-able Exceptions?
>>
>> Thanks,
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0790c669-8181-40a8-8aba-cf58d40fa560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to