Why does resharper say 'Catch clause with single 'throw' statement is redundant'?
问题 I thought throwing an exception is good practice to let it bubble back up to the UI or somewhere where you log the exception and notify the user about it. Why does resharper say it is redundant? try { File.Open("FileNotFound.txt", FileMode.Open); } catch { throw; } 回答1: Because try { File.Open("FileNotFound.txt", FileMode.Open); } catch { throw; } is no different than File.Open("FileNotFound.txt", FileMode.Open); If the call to File.Open(string, FileMode) fails, then in either sample the