Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 15
    If you were going to do that, you don't want to catch(Exception ex) { throw ex; } - instead just catch { throw; } Commented Oct 26, 2010 at 16:40
  • 4
    Lets not forget about finally blocks ? Commented Oct 26, 2010 at 16:42
  • 1
    You should specify the language in the tags. You're getting into more detail than is common to most implementations of exceptions, and ignoring things outside the blocks. In C++, for example, the most important part of exception handling is knowing how to write exception-safe programs. Commented Oct 26, 2010 at 20:42
  • possible duplicate of Improving exception handling? and of Efficient try / catch block usage? Commented Apr 30, 2013 at 7:05
  • I hope you know it is a bad idea to catch any "Exception". You should have nested catch blocks to catch specific exceptions and handle them accordingly(not just throw the exception). Commented Jun 18, 2013 at 5:41