Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difference between error handling and exception handling
#2
Solved: 10 Years, 9 Months, 1 Week ago
I'm not sure of the technical difference, but I believe they are just a difference in languages. VBScript/ASP is an Error object. Other languages that are object oriented (.NET, C++, Java) (3GL) use an exception object for errors.

VBScript example
Code:
on error resume next
a = 1/0
if err.number <> 0 then
  msgbox err.description
end if

VB.NET example
Code:
Try
  a=1/0
Catch (ex as exception)
  msgbox ex.message
End Try

C#
Code:
try
{
  a=1/0
}
catch (exception ex)
{
  msgbox ex.message
}

The exception is more powerful. It is also not dependent on the vague and often odd Microsoft Error codes to trigger a handle condition. For example, you can actually test for an exception of type System.IO.Exception instead of trying to case all the -214XXXXX error codes.

Hope this helps.
Reply


Messages In This Thread
RE: Difference between error handling and exception handling - by jsknight1969 - 11-10-2009, 09:07 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)