Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Indy Exception abfangen (https://www.delphipraxis.net/135742-indy-exception-abfangen.html)

Novo 16. Jun 2009 23:37


Indy Exception abfangen
 
hi,
was ist denn da bitte falsch?
Egal ob ich per Firewall das Programm blocke oder nicht,
es wirft imemr eine access denied raise exception von Indy, aber try except trifft nie ein, sprich:
Delphi-Quellcode:
var_Newsticker := 'You are not connected to the Internet (or your Firewall is blocking me) or my Homepage is down. Look for Help and Updates @ www.xyz.com';
trifft nie ein und bleibt somit leer!
Warum?


Delphi-Quellcode:
IdHTTPUpdate.ReadTimeout := 3000;
IdHTTPUpdate.ConnectTimeout := 3000;
if InternetGetConnectedState(nil, 0) then
try //1
masterserver  := IdHTTPUpdate.Get(masterserver);
masterserver  := StringsucheVor(masterserver,'<frame src="','"');
onlineSettings := IdHTTPUpdate.Get(masterserver+'EasyMangosHandler/onlinesettings.ini');
finally
try //2
AktuelleVersion  := StringsucheVor(onlineSettings,'Version=<','>');
var_Newsticker   := StringsucheVor(onlineSettings,'News=<','>');
var_Maps_download := StringsucheVor(onlineSettings,'Maps_Download=<','>');
DownloadLink     := StringsucheVor(onlineSettings,'DownloadLink=<','>');
Changelog        := StringsucheVor(onlineSettings,'Changelog=<','>');
except //2
var_Newsticker := 'You are not connected to the Internet (or your Firewall is blocking me) or my Homepage is down. Look for Help and Updates @ www.xyz.com';
end;

end else //1
begin
var_Newsticker := 'You are not connected to the Internet (or your Firewall is blocking me) or my Homepage is down. Look for Help and Updates @ www.xyz.com';
end;

omata 16. Jun 2009 23:59

Re: Indy Exception abfangen
 
Hast du mal mit dem Debugger rausgefunden, in welcher Zeile die Exception ausgelöst wird?

mirage228 17. Jun 2009 00:33

Re: Indy Exception abfangen
 
Tausch mal finally und except. Bei einem Fehler wird derzeit bei dir der finally Block aufgerufen, wo aber nicht mehr der except-Block zum Zuge kommt...

Novo 18. Jun 2009 08:33

Re: Indy Exception abfangen
 
Zitat:

Zitat von mirage228
Tausch mal finally und except. Bei einem Fehler wird derzeit bei dir der finally Block aufgerufen, wo aber nicht mehr der except-Block zum Zuge kommt...

gemacht, aber er greift nicht beim try-except.
Indy ignoriert das völlig --.--


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:29 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz