Contents

Exception Handling


Introduction

Exception Handling provides mechanisms to adequately handle abnormal situations. The goal of exception handling is to resolve an abnormal situation by bringing the program into a state that allows secure continuation. Exception handling is used to write error-robust programs.

More frequently seen abnormal situations are:

Even the earliest Smalltalk systems provided methods that were designed to handle exceptional situations. General exception handling was added later. The principle of exception handling is to secure a statement or a sequence of statements by an additional statement (the so-called handler) that takes control when an exceptional event occurs.

The simple exception handling facilities are essentially a collection of methods that are called with a handler, usually with a block. In general exception handling, exception handlers are always placed around a block and have the responsibility to handle the exceptions that occur during the evaluation of that block.


Contents