Skip to content

Commit

Permalink
Catch additional exception
Browse files Browse the repository at this point in the history
`File.GetLastWriteTimeUtc` can throw several exceptions. One of them (`NotSupportedException`) was not covered in our catch clauses.

This exception was observed in microsoft/WindowsAppSDK#1525, where an invalid path string was being provided. When this exception is caught, the file is considered unavailable, and we log the path in the up-to-date check output. This will unblock further diagnosis.
  • Loading branch information
drewnoakes committed Oct 15, 2021
1 parent 7b2f182 commit 92f0f7d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public bool TryGetLastFileWriteTimeUtc(string path, [NotNullWhen(true)]out DateT
catch (UnauthorizedAccessException)
{
}
catch (NotSupportedException)
{
}

result = null;
return false;
Expand Down

0 comments on commit 92f0f7d

Please sign in to comment.