Catch(Exception)
Why do not we use catch(Exception) in Asp.net?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
SenthilkumarRank #387 · 6.5K reputationPosted Mar 12, 2012, 9:49 PM EDT
Run time needs to find the appropriate filter(catch) and it needs to check with local os.
carefully flushes the stack executes the finally blocks and transfer over than dump utility.
The stack trace preparation is costly in the operating system and it needs to prepare the exception table which inherits from the base class.
The ASP.Net execution engine needs to find the matching exception with the local os and it will load all the required details for the exception.
Thats why we need to use the exception only when its required.
As a programmer, we should not where the possibility of error occurs. We have to handle in the programming and if you suspect the error may come then you have to go for exception.
If it is useful then mark it as "Accepted Answer"