I have some code which ignores a specific exception.
try { foreach (FileInfo fi in di.GetFiles()) { collection.Add(fi.Name); } foreach (DirectoryInfo d in di.GetDirectories()) { populateItems(collection, d); } } catch (UnauthorizedAccessException ex) { //ignore and move onto next directory }
of course this results in a compile time warning as ex is unused. Is there some standard accept noop which should be used to remove this warning?
Just rewrite it as