Closed jimmyl02 closed 5 months ago
actually to save some time for others who may find this thread, looks like Google helpfully returns a detailed error in the grpc response, we just need to convert the error to a status and you can then get the details via
respStatus := status.Convert(err)
fmt.Println(status.Details())
It's great, I'm also looking for a detailed error in GRPC, but I only found one GoogleAdsError and I don't know how to use it In addition, this code is a little error:
respStatus := status.Convert(err)
fmt.Println(respStatus .Details())
I think I know how to use GoogleAdsError. This is an example
link, err := clinkServiceClient.MutateCustomerClientLink(ctx, linkCustomer)
if err != nil {
apiErr := status.Convert(err)
for _, detail := range apiErr.Details() {
adsError := detail.(*errors.GoogleAdsFailure)
errs := adsError.GetErrors()
for _, googleErr := range errs {
fmt.Printf("\n\nError message: \t\t\t\t %s\n", googleErr.GetMessage())
fmt.Printf("Error code: \t\t\t\t %s\n", googleErr.GetErrorCode())
errCode := googleErr.GetErrorCode()
x2 := errCode.GetCustomerClientLinkError()
fmt.Printf("Error customer_client_link_error: \t %+v\n", x2)
fmt.Printf("Error trigger: \t\t\t\t %s\n", googleErr.GetTrigger())
location := googleErr.GetLocation()
for _, loc := range location.GetFieldPathElements() {
fmt.Printf("Error field_path_elements: index:%+v name: %+v\n", loc.GetIndex(), loc.GetFieldName())
}
}
fmt.Printf("Error request_id: \t\t\t %+v\n", adsError.GetRequestId())
}
return "", err
}
Hi, thanks for maintaining this project. I was wondering if there is a way to get more verbose error messages when something goes wrong?
With this golang library I see error messages like the following but it is hard to debug what is wrong
Using the official python sdk the error messages are much more verbose like the following example.
Is it supported / possible to get these verbose error messages with the current library? Appreciate any help / pointers, thanks!