IBM Computer, Laptops and Servers

Back Homepage Content Directory Resource Guide Blog

Error Handling

For years, the weak part of most of the languages supported by Microsoft has been the error handling capability. In most cases this error handling was a variant of 2 statements:
On Error Goto; and
On Error Resume Next
Which resulted in branching to an End statement, or continuing on as if nothing had happened.
Taking a page from the Java model, Microsoft, in order to achieve cross platform uniformity with all of the .Net languages, has adopted the
Try..Catch..Finally..End Try method of handling errors. This allows an error to be handled in the routine in which it occurs. If the exception is not caught, it is referred to the calling procedure, and so on and so on. If no exception is caught by the end of the calling chain, the user is notified by a dialog box.
Exception objects have 4 properties in common. The Message property is the text which describes the error. It is similar to the old Err.description. StackTrace returns a string which traces the path from where the exception was originally thrown. The Source property returns s the name of the routine where the exception was thrown. This is analogous to Err. Source. HelpLink returns the URL or URN to the helpfile associated with the error.
Some of the more common exceptions are listed in the following table:
System.AppDomainUnloadedException Thrown when attempting to use an unloaded application domain.
System.ApplicationException Thrown when a non-fatal application error has occurred
System.ArgumentException Thrown when an argument passed is not valid.
System.ArgumentNullException Thrown when a null is passed as a method parameter that does not accept null values.
System.ArgumentOutOfRangeException Thrown when a passed value is outside the range of a methods parameter.
System.ArithmeticException Thrown when an error occurs while performing arithmetic and conversion operations.
System.ArrayTypeMismatchException Thrown when adding a value of the incorrect data type to an array.
System.DivideByZeroException Thrown whenever a value is divided by zero.
System.DllNotFoundException Thrown when a DLL referenced as imported is not available
System.IndexOutOfRangeException Thrown when trying to access an invalid index in an array
System.InvalidCaseException Thrown when an invalid conversion attempt is made.
System.NullReferenceException. Thrown when attempting to dereference a null object reference
System.OutOfMemoryException Thrown when memory is not available to perform the specified task.
System.OverflowException Thrown when an operation overflow occurs
System.RankException Thrown when an array with the wrong number of dimensions is passed to a methods parameter.
System.SystemException Is the base class for all exception classes in the System namespace
System.Data.ConstraintException Thrown when a constraint is violated.
System.Data.DataException. Thrown when an ADO.NET component generates an error
System.Data.DBConcurrencyException Thrown when the number of rows affected in an update procedure is zero.
System.Data. DeletedRowInaccessibleException Thrown when attempting to perform data manipulation operations on a data row that has been deleted.
System.Data. InvalidConstraintException Thrown when a data relationship is violated.
System.Data. NoNullAllowedException Thrown when inserting a null value where one is not accepted.
System.IO. DirectoryNotFoundException Thrown when a specified directory cannot be found.
System.IO.FileLoadException Thrown when a file cannot be loaded.
System.IO.IOException. Thrown when an I/O error occurs
System.IO.PathToLongException Thrown when a path or file name are too long.
System.Runtime.Remoting.. Thrown when an error occurs during a remote RemotingException operation
System.Runtime.Remoting. RemotingTimeoutException Thrown when the response of a server or client exceed a predefined interval.
System.Runtime.Remoting.ServerException Thrown when an error occurs while working with a remote component that is an unmanaged application incapable of throwing an exception.
System.Runtime.Serialization.SerializationException Thrown when an error occurs during the serialization or deserialization of a component.
System.Web.HttpException Allow an http exception to be thrown
System.XML.XmlException Provides exception information about the last XML exception.

Laptop Battery Immediately following the TRY command, the code to be executed is placed. If an error is detected, control is passed immediately to the CATCH commands. The CATCH commands should be listed with the most restrictive listed first. There are in most cases multiple CATCH blocks to accommodate different types of errors and different resolutions for each. You can use s WHEN with a CATCH line to additionally specify conditions for that CATCH block to be executed. A TRY block can be exited at any time upon encountering an EXIT TRY command
Dim a,b as Integer
Try
a=a/b
b=1000000000000
Catch exn as DividebyZeroException
Console.WriteLine("You tried to divide by zero")
Catch exn as OverflowException 'never executed
Console.WriteLine("Number too big")

Computer memory is the quickest, cheapest, and easiest way to improve the performance of your system. Find RAM memory upgrades for desktops, laptops, servers, and printers all backed by a lifetime warranty and guaranteed compatible with your computer. Shipping is an everyday low price of $1.99! Computer Memory Outlet sells memory compatible with all leading computer manufacturers like Dell, Apple, Compaq, HP, Sony, IBM, Lenovo, and many more.”

Thinkpad Finally
Console.WriteLine(a,b)
End Try

Apart from redirecting the copy of requested webpage to client’ laptop, web server also detects errors. These errors are commonly known as ‘Server Errors’ and are displayed on the screen with error code and error message.

Microsoft
The FINALLY clause is optional, and used to clean up any code or partially executed block of code which may have been interrupted. The code between FINALLY and ENDTRY is guaranteed to be executed whether or not an exception was thrown.
You can also THROW an exception (create your own error to trigger) by using the THROW keyword, and using the Namespace and Exception as a method, as in:
THROW New System.DividebyZeroException()
Try to use catching exception as sparingly as possible because they add overhead to the project. On the other hand, it is important to trap errors because in so doing you relieve the user of the burden of figuring out what went wrong. In addition, it is often a good idea to keep a database of errors to monitor the performance of the application over time.
Resources
Information on System.IndexOutOfRangeException Class

As a rental organization ICC has kept strong focus on service by following strict quality control procedures and providing 24 hour a day, 7 day a week technical support on every computer rental. Feel secure when renting a computer from iccrents.com. Rent Laptops from Quick, 1000 laptops in stock, HP, CPQ, Dell, IBM, 24x7 Support, Same Day deliveries available nationwide. 20 years of experience.

Laptop Computers This resource provides information on System.IndexOutOfRangeException Class.
. Information on System.ArgumentException Class
This resource provides information on System.ArgumentException Class.

Description Have a friend with a laptop Do they always complain about the heat Cool them down with HandStands' Cool Lift. Designed to help promote air flow and reduce heat, the Cool Lift is perfect for notebook computers with the latest hot processors from Intel, AMD, Motorola, or IBM. Proof Shields for Laptops help prevent scratches from normal laptop use. Proof Shield. It even completely disappears when applied!

Laptop Computer

You searched for information on battery and laptop computer. Your new compaq laptop battery comes in a discharged condition and must be charged before use (refer to your computer manual for charging instructions). Of course, once you decide on the laptop computer battery you need, you will want to receive it right away. Plug battery pack into DC input of your laptop computer which is located in backside of laptop usually. Toshiba laptop battery laptop batteries, laptop battery, toshiba laptop battery, batteries for laptop computer.

[ Comment, Edit or Article Submission ]

Share this:

Add To Yahoo MyWeb Add To Google Bookmarks Add To Furl Fav This With Technorati Add To Newsvine Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This Digg This Add To Del.icio.us Add To Reddit

More about:

Nov December 2008 Jan
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

IBM Computer, Laptops and Servers Blog on Technorati Related Blog of IBM Computer, Laptops and Servers on Sphere
Content Directory
Resource Guide


Acronis Data Backup Software and Disaster Recovery

Website Links
IBM Computer, Laptops and Servers Copyright © 2008 www.ibmfans.com. All rights reserved. Site Map
Homepage | Blog | Advertise | Privacy Policy | Disclaimer | Contact Us | Links