Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difference between error handling and exception handling
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Exceptions and Errors fall into three categories: checked exceptions, unchecked exceptions, and errors.

Checked Exceptions

Checked by the compiler at compile time
Methods that throw checked exceptions must indicate so with throws which must propagate up the calling stack until the exception is handled
Checked exceptions require explicit catching with a catch block
These include exceptions of the type Exception, except for RuntimeException and its subtypes

Unchecked Exceptions

Not checked at compile time by the compiler
Occur during runtime due to programmer error (i.e. out-of-bounds, divide by zero, etc.) or system resource exhaustion
These do not have to be caught (as they are not checked, they only are known when they occur)
Methods may throw unchecked exceptions but do not have to indicate so in declaration
These are exceptions and subtypes of RuntimeException

Errors

Errors are typically unrecoverable and present serious conditions
Errors are not checked at compile time and do not have to be (but can be) caught or handled
Reply


Messages In This Thread
RE: Difference between error handling and exception handling - by smitapawar610 - 12-11-2018, 05:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Handling SSL certificates madhuri87 1 4,204 08-13-2015, 09:14 PM
Last Post: Ankur
  QTP hangs on handling error window dtamilarasan 1 3,806 06-04-2013, 02:45 PM
Last Post: basanth27
  Handling Object Repositories dynamically inside For Loop danny2012 3 4,061 07-13-2012, 02:00 PM
Last Post: danny2012
  Difference between "Set" and "Type" falvi 2 10,151 04-03-2012, 05:54 PM
Last Post: falvi
  Difference between RFT & QTP? SweetyChowdhury 18 20,700 08-26-2011, 07:43 AM
Last Post: nana1355

Forum Jump:


Users browsing this thread: 1 Guest(s)