throw; is better choice than throw exception. {The stack trace is maintained in previous}
private void Test() {
Test2();
}
private void Test2() {
try {
Test3();
}
catch(Exception e){
//some cleanup code
throw;
// throw e; //This will lose the stack trace.
}
}
private void Test3(){
//some logic
throw new Exception("abcd");
}
Friday, December 10, 2004
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment