Exception Guarantees
Exception handling is the process of responding to the occurrence, during computation, of exceptions – anomalous or exceptional situations requiring special processing – often changing the normal flow of program execution. It is provided by specialized programming language constructs or computer hardware mechanisms.
In general, an exception is handled (resolved) by saving the current state of execution in a predefined place and switching the execution to a specific subroutine known as an exception handler. If exceptions are continuable, the handler may later resume the execution at the original location using the saved information. For example, a floating point divide by zero exception will typically, by default, allow the program to be resumed, while an out of memory condition might not be resolvable transparently.
Alternative approaches to exception handling in software are error checking, which maintains normal program flow with later explicit checks for contingencies reported using special return values or some auxiliary global variable such as C's errno or floating point status flags; or input validation to preemptively filter exceptional cases.
Read more about Exception Guarantees: Exception Handling in Hardware, Exception Handling in Software
Famous quotes containing the words exception and/or guarantees:
“The Jew is neither a newcomer nor an alien in this country or on this continent; his Americanism is as original and ancient as that of any race or people with the exception of the American Indian and other aborigines. He came in the caravels of Columbus, and he knocked at the gates of New Amsterdam only thirty-five years after the Pilgrim Fathers stepped ashore on Plymouth Rock.”
—Oscar Solomon Straus (18501926)
“... if a person is to be unconventional, he must be amusing or he is intolerable: for, in the nature of the case, he guarantees you nothing but amusement. He does not guarantee you any of the little amenities by which society has assured itself that, if it must go to sleep, it will at least sleep in a comfortable chair.”
—Katharine Fullerton Gerould (18791944)