uses System.SysUtils;
//любая подпрограмма может возбудить исключение:
//"throws" в сигнатурах нет
procedure MethodWithException;
begin
raise Exception.Create('test exception');
end;
begin
try
MethodWithException;
except
on E: Exception do
WriteLn('Error happened: ', E.Message);
end;
end.