|
|
|
The Visual Basic .NET Err.Raise method and the Throw command are (partially) compatible. For example, you can use a Try...End Try block to catch an error raised with the Err.Raise method, and you can use an On Error Resume Next and the Err object to neutralize and inspect an exception object created by the Throw command. The old and the new error trapping mechanisms don't coexist well, though, and there are a few limitations. For example, you can't have an On Error Resume Next statement and a Try...End Try block in the same procedure.
To assist you in porting existing applications to VB.NET, the Err object has been extended with the new GetException method, which returns the Exception object that corresponds to the current error. This feature lets you preserve old-style error handlers in those procedures that don't lend themselves to an easy porting to the new syntax. This new method also enables such procedures them to correctly throw an exception object to their caller, where the exception can be processed using a Try block as usual: |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|