Sorry -- previous reply had a logic error -- this works ...
Try
ret_val = service.mutate( ... )
Catch aw_ex As Google.Api.Ads.AdWords.Lib.AdWordsApiException
' Get the API exception ...
Dim api_ex As ApiException = TryCast( aw_ex.ApiException, ApiException )
' Set flag to indicate whether or not the exception was handled ...
Dim ex_handled = false
If ( Not api_ex Is Nothing ) Then
If ( Not api_ex.errors is Nothing ) Then
If ( api_ex.errors.Length = 1 ) Then
Dim aga_error = TryCast( api_ex.errors( 0 ), AdGroupAdError )
If ( Not aga_error is Nothing )
If ( aga_error.reason =
AdGroupAdErrorReason.CANNOT_OPERATE_ON_REMOVED_ADGROUPAD ) then
' Do whatever you need to do ...
ex_handled = true
End If
End If
End If
End If
' If we could not handle the API error, throw the exception for
' manual inspection ...
If ( Not ex_handled ) then
Throw New System.Exception( "AdWords API Error.", aw_ex )
End If
End If
Catch ex As System.Exception
' Handle system Exception ...
End Try
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
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/b6298b64-9e92-4a02-872c-5686dab3f648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.