Skip to content

Commit

Permalink
add exception message to telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Amitla Vannikumar committed Oct 9, 2024
1 parent baaab8d commit 9a922b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Microsoft.ComponentDetection.Common.Telemetry.Records;
namespace Microsoft.ComponentDetection.Common.Telemetry.Records;

public class GoGraphTelemetryRecord : BaseDetectionTelemetryRecord
{
Expand All @@ -19,4 +19,6 @@ public class GoGraphTelemetryRecord : BaseDetectionTelemetryRecord
public string GoCliCommandError { get; set; }

public string GoModVersion { get; set; }

public string Exception { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ protected override async Task OnFileFoundAsync(ProcessRequest processRequest, ID
catch (Exception ex)
{
this.Logger.LogError(ex, "Failed to detect components using go cli. Location: {Location}", file.Location);
record.Exception = ex.Message;
}
finally
{
Expand Down

0 comments on commit 9a922b4

Please sign in to comment.