-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary of changes Add catch blocks for the `FormatException` in all aspect where the `Uri` is get from the instance. ## Reason for change [Error identified on Error Tracking](https://app.datadoghq.com/error-tracking?query=service%3Ainstrumentation-telemetry-data%20%2Aiast%2A%20%40lib_language%3Adotnet%20-%2ASystem.OutOfMemoryException%2A%20-%2ASystem.Threading.ThreadAbortException%2A&et-side=data&fromUser=true&issueId=0374ce80-0ddb-11ef-bfb2-da7ad0900002&refresh_mode=sliding&source=all&from_ts=1734966392184&to_ts=1735571192184&live=true). The instrumentation fails because of an invalid string during the creation of the `Uri`. The tainting would not happen because it requires the `OriginalString` from the `Uri` to keep tracks of its usage. ## Implementation details From the [Microsoft Docs](https://learn.microsoft.com/en-us/dotnet/api/System.UriBuilder.Uri?view=net-6.0): > [UriFormatException](https://learn.microsoft.com/en-us/dotnet/api/system.uriformatexception?view=net-6.0) The URI constructed by the [UriBuilder](https://learn.microsoft.com/en-us/dotnet/api/system.uribuilder?view=net-6.0) properties is invalid. I did choose FormatException because from the [docs](https://learn.microsoft.com/en-us/dotnet/api/System.UriBuilder.Uri?view=net-6.0#exceptions), they say: Note: In .NET for Windows Store apps or the Portable Class Library, catch the base class exception, [FormatException](https://learn.microsoft.com/en-us/dotnet/api/system.formatexception?view=net-6.0), instead.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters