It is perfectly legitimate to throw exceptions from catch and finally blocks

A) True
B) False

Showing Answers 1 - 4 of 4 Answers

samiksc

  • Jan 9th, 2006
 

Answer is (A) True.

Catch and finally blocks are just like other code blocks, and you can write any legitimate C# code, including try, throw, catch and finally.

imqwer

  • Jan 24th, 2006
 

I think the stress in on the phrase 'perfectly legitimate'.  So, the answer should be B)False. It is not perfectly legitimate.

Logically, you should throw exceptions from the Try block, and catch them in your Catch block and perform some sort of cleaning operations in finaly block. 

  Was this answer useful?  Yes

Pan

  • Jan 31st, 2006
 

True, it is legitimate to throw exception from finally block but it should be avoided as fas as possible.

  Was this answer useful?  Yes

sathya

  • Aug 30th, 2006
 

There is no need to avoid throwing exceptions from finally block as a matter from any parts of the code.  The main idea of throwing exception is to inform caller of this block of the code about the execption.  Imagine a class library may have a finally block to handle the exceptions and it may need to rethrow this execption to the caller if this exeception need to be handled by caller.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions