异常处理

uses System.SysUtils;

procedure MethodWithException;
begin
  try
    raise Exception.Create('test exception');
  except
    //partial processing, then pass the
    //exception on: bare raise re-raises
    on E: Exception do
    begin
      WriteLn('partial processing');
      raise;
    end;
  end;
end;

begin
  try
    MethodWithException;
  except
    on E: Exception do
      WriteLn(E.Message);
  end;
end.