How to throw an caught exception from cath block?

Answer Posted / lonesloane

try{
// code that throws exception
}
catch(Exception ex){
// Do whatever needed with exception
Console.Writeline(ex.Message);
throw; <== will re-throw the caught exception
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What’s a strong name?

527


Is a structure a class?

500


What is the base class from which all value types are derived?

503


What is the purpose of a constructor in c#?

465


What is parallel foreach in c#?

551






Does c# support try-catch-finally blocks?

480


Can an abstract class have a constructor c#?

493


Why do we parse in c#?

468


Is Multiple-inheritance supported by c#?

587


What are anonymous functions in c#?

526


Describe the overview of clr integration.

497


Is concurrent queue thread safe?

481


What is type cast in C#?

565


What is collection of classes in c#?

518


Is it true that all c# types derive from a common base class?

532