Skip to content

raise generic error without path information#15088

Merged
brettfo merged 1 commit into
mainfrom
dev/brettfo/nuget-missing-log
May 21, 2026
Merged

raise generic error without path information#15088
brettfo merged 1 commit into
mainfrom
dev/brettfo/nuget-missing-log

Conversation

@brettfo
Copy link
Copy Markdown
Contributor

@brettfo brettfo commented May 20, 2026

When SDK dependency discovery fails to produce a log file we get a FileNotFoundException at runtime but that exception also contains the missing filename which is randomly generated in temp. Because of this, our telemetry generates a new error event for every one which makes it difficult to analyze how prevalent this error actually is. This PR raises a more generic exception so all like errors can be bucketed together.

@github-actions github-actions Bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label May 20, 2026
Copy link
Copy Markdown

@albertoblue87-netizen albertoblue87-netizen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@brettfo brettfo marked this pull request as ready for review May 20, 2026 21:37
@brettfo brettfo requested a review from a team as a code owner May 20, 2026 21:37
Copilot AI review requested due to automatic review settings May 20, 2026 21:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces telemetry cardinality for NuGet SDK project dependency discovery failures by ensuring the thrown exception no longer includes a randomly generated temporary binlog path when the binlog is missing.

Changes:

  • Adds an explicit File.Exists(binLogPath) check after MSBuild execution.
  • Throws a FileNotFoundException with a stable, generic message when the binlog was not produced, avoiding path-specific exception details.
Show a summary per file
File Description
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs Detects missing MSBuild binlog and throws a stable exception message to improve telemetry bucketing.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

Copy link
Copy Markdown

@albertoblue87-netizen albertoblue87-netizen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@brettfo brettfo force-pushed the dev/brettfo/nuget-missing-log branch from d84cd08 to 98d1729 Compare May 21, 2026 20:33
@brettfo brettfo merged commit 9bfd0b8 into main May 21, 2026
106 checks passed
@brettfo brettfo deleted the dev/brettfo/nuget-missing-log branch May 21, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: dotnet:nuget NuGet packages via nuget or dotnet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants