anchor.diff:  procedure TIRC.DoConnect;
   begin
     try
  -     FIdIRC.Connect();
  +     FIdIRC.Connect;
     except
  -    try
  -      FIdIRC.Disconnect(False);
  -    except
  +    on E: Exception do
  +    begin
  +      try
  +        FIdIRC.Disconnect(False);
  +      except
  +      end;
  +
  +      if FIdIRC.IOHandler <> nil then
  +        FIdIRC.IOHandler.InputBuffer.Clear;
  +
  +      MessageBox(Format('Cannot connect to server: %s', [E.Message]));
  +      Abort;
       end;
  -    if FIdIRC.IOHandler <> nil then
  -       FIdIRC.IOHandler.InputBuffer.Clear;
  -
  -    MessageBox('Lost connection to server.');
     end;
   end;
   
   procedure TIRC.MessageBox(const Msg: string);
   begin
  +  SendServerMessage('Disconnected from server.');
     if Assigned(FOnShowPopup) then
        FOnShowPopup(Msg);
   end;
   
  +procedure TIRC.HandleIdException(E: EIdException);
  +begin
  +  MessageBox(E.Message);
  +  if not FIdIRC.Connected then
  +    Connect;
  +end;
  +
   procedure TIRC.Connect;
   begin
     if FIdIRC.Connected then
  -  begin
  -    MessageBox(Format(StrAlreadyConnected, [FIdIRC.Host]));
  -    Exit;
  -  end;
  +     Disconnect;
   
     ConfigureEvents;
     ReadConfig;
  
positive.code:     if IsCommand then
         RawString := FCommands.GetRawCommand(RawString);
  
      FIdIRC.Raw(RawString)
    end
    else
      MessageToChannel(Message);
  
negative.code:       procedure AutoJoinChannels;
        procedure Connect;
        procedure Disconnect;
        procedure Join(const Name: string);
        procedure Part(const Name: string);
        procedure SendMessage(const Message: string);
        constructor Create;
        destructor Destroy; override;
  