Can we throw exception from catch Block?
Answers were Sorted based on User's Feedback
Answer / deepika
The above answer is wrong.We can absolutely throw
exceptions in catch blocks.This is called bubbling the
exceptions to one level higher.If catch block can not
handle exceptions,then it can throw the exception that it
caught, to it's caller
| Is This Answer Correct ? | 46 Yes | 1 No |
Yes. we can throw the exception from the catch block.
If anyone have confusion then try this code:
protected void Button1_Click(object sender, EventArgs e)
{
try
{
Test();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
private void Test()
{
try
{
throw new Exception("Dev");
}
catch (Exception ex)
{
throw ex;
}
}
| Is This Answer Correct ? | 40 Yes | 2 No |
Answer / manee
we can throw the exception in catch block by using throw New
Exception("Exception Message")
| Is This Answer Correct ? | 24 Yes | 2 No |
Answer / kakarala sowjanya
You can catch exceptions when the purpose of catching the
exception is to re-throw or transfer the exception to a
different thread. so we can throw exception from catch block
| Is This Answer Correct ? | 22 Yes | 1 No |
Answer / kamlesh sharma
yes we can through exception If catch block can not
handle exceptions,then it throw the exception to it's
caller
| Is This Answer Correct ? | 16 Yes | 2 No |
Answer / subbarao
i think answer is NO, because catch block is used to catch
the exceptions thrown
| Is This Answer Correct ? | 9 Yes | 69 No |
What Are Different Types of Debbugers
2 Answers Accenture, TCS, Wipro,
What is difference between viewstate and session in asp net?
Explain the various authentication mechanisms in asp.net.
True or False: To test a Web service you must create a windows application or Web application to consume this service?
What is the difference between custom controls and user controls?
What is server side in asp.net?
Explain how can we inherit a static variable?
If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
What is the difference between control and component?
What is the difference between debug and release?
What is the difference between dynamic SGA and static SGA?
What are the differences between code behind and code inline?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)