dinesh Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of some condition that changes the normal flow of execution. For signaling conditions that are part of the normal flow of execution see the concepts of signal and event handler.
In general, current state will be saved in a predefined location and execution will switch to a predefined handler. Depending on the situation, the handler may later resume the execution at the original location, using the saved information to restore the original state. For example, an exception which will usually be resumed is a page fault, while a division by zero usually cannot be resolved transparently.
From the processing point of view, hardware interrupts are similar to resumable exceptions, although they are usually not related to the current program flow.
From the point of view of the author of a routine, raising an exception is a useful way to signal that the routine could not execute normally, for example when its input arguments are invalid (a zero denominator in division) or when a resource it relies on is unavailable (a missing file, or a disk error). In systems without exceptions, the routine would need to return some special error code. However, this sometimes is complicated by the semipredicate problem, in which users of the routine need to write extra code to distinguish normal return values from erroneous ones.
In runtime engine environments such as Java or .NET there exist tools that attach to the runtime engine and every time that an exception of interest occurs they record debugging information that existed in memory at the time the exception was thrown (call stack and heap values). These tools are called Automated Exception Handling or Error Interception tools and they provide 'root-cause' information for exceptions.
this is taken from link http://en.wikipedia.org/wiki/Except ion_handling
Answered by
laks
, an ibibo Master,
at
3:29 PM on May 13, 2008