C#: Suppress cs/catch-of-all-exceptions

This commit is contained in:
calum
2019-01-29 18:22:12 +00:00
parent 83e2689645
commit f39daaeeab
3 changed files with 4 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ namespace Semmle.Autobuild
var o = JObject.Parse(File.ReadAllText(path));
version = (string)o["sdk"]["version"];
}
catch
catch // lgtm[cs/catch-of-all-exceptions]
{
// not a valid global.json file
continue;

View File

@@ -63,7 +63,8 @@ namespace Semmle.Autobuild
ToolsVersion = new Version(toolsVersion);
ValidToolsVersion = true;
}
catch // Generic catch clause - Version constructor throws about 5 different exceptions.
catch // lgtm[cs/catch-of-all-exceptions]
// Generic catch clause - Version constructor throws about 5 different exceptions.
{
builder.Log(Severity.Warning, "Project {0} has invalid tools version {1}", path, toolsVersion);
}

View File

@@ -136,7 +136,7 @@ namespace Semmle.Util
entries[0] :
Path.Combine(parentPath, name);
}
catch (Exception)
catch // lgtm[cs/catch-of-all-exceptions]
{
// IO error or security error querying directory.
return Path.Combine(parentPath, name);