Skip to content

Commit c909427

Browse files
committed
Log hydration calculation errors to telemetry
1 parent 0ddb3fa commit c909427

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

GVFS/GVFS.Common/GitStatusCache.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,10 @@ private void UpdateHydrationSummary()
372372
}
373373
else
374374
{
375+
metadata["Exception"] = hydrationSummary.Error?.ToString();
375376
this.context.Tracer.RelatedWarning(
376377
metadata,
377-
$"{nameof(GitStatusCache)}{nameof(RebuildStatusCacheIfNeeded)}: hydration summary could not be calculdated.",
378+
$"{nameof(GitStatusCache)}{nameof(RebuildStatusCacheIfNeeded)}: hydration summary could not be calculated.",
378379
Keywords.Telemetry);
379380
}
380381
}

GVFS/GVFS.Common/HealthCalculator/EnlistmentHydrationSummary.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class EnlistmentHydrationSummary
1212
public int TotalFileCount { get; private set; }
1313
public int HydratedFolderCount { get; private set; }
1414
public int TotalFolderCount { get; private set; }
15+
public Exception Error { get; private set; } = null;
16+
1517

1618
public bool IsValid
1719
{
@@ -67,14 +69,15 @@ public static EnlistmentHydrationSummary CreateSummary(
6769
TotalFolderCount = totalFolderCount,
6870
};
6971
}
70-
catch
72+
catch (Exception e)
7173
{
7274
return new EnlistmentHydrationSummary()
7375
{
7476
HydratedFileCount = -1,
7577
HydratedFolderCount = -1,
7678
TotalFileCount = -1,
7779
TotalFolderCount = -1,
80+
Error = e,
7881
};
7982
}
8083
}

0 commit comments

Comments
 (0)