10
“ throw”和“ throw ex”之间有区别吗?
有些帖子问这两者之间已经有什么区别。(为什么我什至不得不提这个...) 但是我的问题有所不同,在另一种类似于神的错误处理方法中,我称呼为“ throw ex” 。 public class Program { public static void Main(string[] args) { try { // something } catch (Exception ex) { HandleException(ex); } } private static void HandleException(Exception ex) { if (ex is ThreadAbortException) { // ignore then, return; } if (ex is ArgumentOutOfRangeException) { // Log …