Which code segment should you use?
A. catch{Logger.Log(new Exception());throw;}
B. catch{var ex = new Exception();throw ex;}
C. catch (Exception ex){Logger.Log(ex);throw ex;}
D. catch (Exception ex){Logger.Log(ex);throw;}
Answer:D
Which code segment should you use?
A. catch{Logger.Log(new Exception());throw;} B. catch{var ex = new Exception();throw ex;} C. catch (Exception ex){Logger.Log(ex);throw ex;} D. catch (Exception ex){Logger.Log(ex);throw;}