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.
- Create .NET Core WebApi project
- Set it up with Google Ads API lib
- Add this line to startup.cs:
TraceUtilities.Configure(TraceUtilities.DETAILED_REQUEST_LOGS_SOURCE, gadsLogPath, SourceLevels.Information);
- 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.