Skip to content

Commit ceeb3a6

Browse files
Potential fix for code scanning alert no. 821: Generic catch clause
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Phileco <132178579+krishnprakash@users.noreply.github.com>
1 parent 40a196a commit ceeb3a6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FeedManagerIO.cs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ public FeedManagerIO(ILogger logger, IRegistryProxy? registryProxy)
2727
{
2828
return new FileInfo(path).Directory?.FullName;
2929
}
30-
catch (Exception exc)
30+
catch (ArgumentException exc)
31+
{
32+
logger.LogWarning($"Failed to get directory of '{path}': {exc}");
33+
}
34+
catch (NotSupportedException exc)
35+
{
36+
logger.LogWarning($"Failed to get directory of '{path}': {exc}");
37+
}
38+
catch (PathTooLongException exc)
3139
{
3240
logger.LogWarning($"Failed to get directory of '{path}': {exc}");
3341
}

0 commit comments

Comments
 (0)