A common usage of exception handling is to obtain and use resources in a "try-it" block, deal with any exceptions in an "exceptions" block, and release the resources in some kind of "final" block which executes whether or not any exceptions are trapped.
Delphi Exception Trapping
Use a try..except..end block to trap and process errors.
Delphi also offers a try...finally where code will execute in the finally section no matter what. It's common to put a try..except inside a try..finally.
Syntax Example:
var y : Double; begin try y := 0; y := (1/y); ShowMessage(FloatToStr(y)); except ShowMessage('You cannot divide by zero.'); end; end;