Ver Mensaje Individual
  #2  
Antiguo 02-09-2011
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.108
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Puedes "capturar" las posibles excepciones que lance el objeto "IdHttp", por ejemplo:

Código Delphi [-]
var
  http: TIdHttp;
begin
  http := TIdHttp.Create( nil );
  try
    try
      Memo1.Text:= http.Get( Trim( Edit1.Text ) );
    except
      // Por ejemplo "HTTP not found"
      on E : EIdHttpProtocolException do
      begin
        ShowMessage( E.Message );
      end;
      // Cualquier otro tipo de excepción
      on E : Exception do
      begin
        ShowMessage( E.Message );
      end;
    end;
  finally
    http.Free();
  end;
end;
Responder Con Cita