googleads / google-ads-dotnet

This project hosts the .NET client library for the Google Ads API.

Home Page:https://developers.google.com/google-ads/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TraceUtilities crashes whole WebAPI application when ListAccessibleCustomers call fails

AlesSturala opened this issue · comments

Description
When you turn on trace utilities, the lib will crash a WebAPI completely. Somehow this happens even in another WebAPI thread so try-catch doesn't help. Thus it also took quite some time to figure out this issue.

Steps to Reproduce:
Please provide a code snippet or steps to consistently reproduce the experienced behavior.

  1. Create .NET Core WebApi project
  2. Set it up with Google Ads API lib
  3. Add this line to startup.cs: TraceUtilities.Configure(TraceUtilities.DETAILED_REQUEST_LOGS_SOURCE, gadsLogPath, SourceLevels.Information);
  4. Execute: customerService.ListAccessibleCustomers() with a random string for a refresh token

Expected behavior:
Shouldn't crash the app, try-catch should be able to handle the error.

Client library version and API version:
Client library version: latest
Google Ads API version: v11
.NET version: .NET 6.0
Operating system (Linux, Windows, ...) and version (if the bug is platform-specific): Windows

Other
I have a working prototype demonstrating this issue in case you need it.

@AlesSturala I think this was introduced as part of a previous refactor and bug fix. There was a try-catch that got dropped during that process. We will get it fixed shortly.