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/8802838e-c187-48c5-9079-7f478313c2b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to