Skip to content

Commit

Permalink
Don't throw an exception when deleting the crashtracking key
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock committed Feb 17, 2025
1 parent 7d24b3d commit e251d32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tracer/src/Datadog.FleetInstaller/RegistryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static bool RemoveCrashTrackingKey(ILogger log, TracerValues values, stri
try
{
var key = Registry.LocalMachine.OpenSubKey(registryKeyName, writable: true);
key?.DeleteValue(crashHandlerPath);
key?.DeleteValue(crashHandlerPath, throwOnMissingValue: false);
log.WriteInfo($"Crash tracking handler path '{crashHandlerPath}' removed from '{registryKeyName}'");

return true;
Expand Down Expand Up @@ -83,6 +83,8 @@ public static bool TryGetIisVersion(ILogger log, [NotNullWhen(true)] out Version
var minor = key.GetValue("MinorVersion") as int? ?? 0;

version = new(major: major, minor: minor);

log.WriteInfo($"Found IIS version: '{major}.{minor}'");
return true;
}
catch (Exception ex)
Expand Down

0 comments on commit e251d32

Please sign in to comment.