Skip to content

Commit

Permalink
Use properties.TryAdd instead of properties.Add to avoid throwing and…
Browse files Browse the repository at this point in the history
… ArgumentException when "StackTrace" key was already added for Crashes
  • Loading branch information
renelaerke authored and dhindrik committed Jul 30, 2024
1 parent bcfe9ba commit 7787b1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TinyInsights/ApplicationInsightsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public Task TrackErrorAsync(Exception ex, Dictionary<string, string>? properties
properties = new Dictionary<string, string>();
}

properties.Add("StackTrace", ex.StackTrace);
properties.TryAdd("StackTrace", ex.StackTrace);

client.TrackException(ex, properties);
client.Flush();
Expand Down

0 comments on commit 7787b1c

Please sign in to comment.