Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As you mentioned Java has checked and unchecked exceptions. For checked exceptions you have to either declare your method throws it, or handle the exception in the method. C# does not have that limitation, your method doesn't have to declare what exception it could possibly throw.</p> <blockquote> <p>100% of methods in the entire application must have at least a standard exception handler, using try/catch/finally blocks; more complex methods must also have additional exception handling for specific exceptions</p> </blockquote> <p>This seems like a stupid requirement. If you have no meaningful way to recover from an exception and continue executing normally, you would ideally allow the exception to bubble up the stack unimpeded. That way when you log the exception (right before shutting down gracefully, or not so gracefully) you'll have a full stack-trace of what exactly caused the exception. It is a very common mistake (from the code I've seen) to use <a href="https://stackoverflow.com/questions/2308979/exception-handling-question/2308988#2308988">pokemon exception handling</a> and logging the exceptions too early (so you know something bad happened but not what piece of code triggered it.</p> <hr> <p>You should also take a look at <a href="https://stackoverflow.com/questions/tagged?tagnames=best-practices%2bexception-handling&amp;sort=votes&amp;pagesize=15">this list of similar question</a> for a good overview of good exception handling practices. </p> <p>And for good measure <a href="http://blogs.msdn.com/ericlippert/archive/2008/09/10/vexing-exceptions.aspx" rel="nofollow noreferrer">Vexing exceptions</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload