Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
117 / 187
Explain briefly about rethrowing an exception?
Answer:
A handler may decide to rethrow the exception caught without processing it. In such situation, we may simply invoke throw without any argument.
Eg: throw;
This cause the current exception to be thrown to the next enclosing try/catch sequence and is caught by a catch statement listed after that enclosing try block.
Asked In ::
Amit
23 Feb, 2019 5:07 AM
A handler may decide to rethrow the exception caught without processing it. In such situation, we may simply invoke throw without any argument.
Eg: throw;
This cause the current exception to be thrown to the next enclosing try/catch sequence and is caught by a catch statement listed after that enclosing try block.
Eg: throw;
This cause the current exception to be thrown to the next enclosing try/catch sequence and is caught by a catch statement listed after that enclosing try block.