<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Die Sache mit den Exceptions]]></title><description><![CDATA[<p>Aloha,</p>
<p>folgendes Problem</p>
<pre><code class="language-cpp">try
{

CString dll = dl_pfad;
tFile = (CHttpFile*)m_is.OpenURL(dl_pfad, 1,INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_DONT_CACHE);

}

catch(CInternetException* e)
{
</code></pre>
<p>Wenn der dl_pfad z.B. &quot;c:/wasweissich/image.jpg&quot; ist, knallt mir das Programm weg. Es geht aber nicht in Exception rein, weil es keine Internet Exception ist, was mir aber nahe lag, da es sich i.d.R. um einen Pfad von einer Webseite handelt an dieser Stelle. Ich parse nämlich Webseiten.</p>
<p>Es handelt sich hier um eine CFileExeption.</p>
<p>Lange Faseln, kurzer Frage.</p>
<p>Ich fange ja mit diesem Codeschnipsel jetzt alle Exceptions ab :</p>
<pre><code class="language-cpp">try
{

CString dll = *it_dl;
tFile = (CHttpFile*)m_is.OpenURL(*it_dl, 1,INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_DONT_CACHE);

}

catch([CException* e)
{
</code></pre>
<p>Was für ein Nachteil, oder auch nicht, ergibt sich, wenn ich nicht feingliedrig CFileExeption benutze, sondern die Vaterklasse CExeption ????</p>
<p>Danke und Grüße</p>
<p>BOA</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149956/die-sache-mit-den-exceptions</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 07:15:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149956.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Jun 2006 20:08:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Die Sache mit den Exceptions on Sun, 11 Jun 2006 20:08:18 GMT]]></title><description><![CDATA[<p>Aloha,</p>
<p>folgendes Problem</p>
<pre><code class="language-cpp">try
{

CString dll = dl_pfad;
tFile = (CHttpFile*)m_is.OpenURL(dl_pfad, 1,INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_DONT_CACHE);

}

catch(CInternetException* e)
{
</code></pre>
<p>Wenn der dl_pfad z.B. &quot;c:/wasweissich/image.jpg&quot; ist, knallt mir das Programm weg. Es geht aber nicht in Exception rein, weil es keine Internet Exception ist, was mir aber nahe lag, da es sich i.d.R. um einen Pfad von einer Webseite handelt an dieser Stelle. Ich parse nämlich Webseiten.</p>
<p>Es handelt sich hier um eine CFileExeption.</p>
<p>Lange Faseln, kurzer Frage.</p>
<p>Ich fange ja mit diesem Codeschnipsel jetzt alle Exceptions ab :</p>
<pre><code class="language-cpp">try
{

CString dll = *it_dl;
tFile = (CHttpFile*)m_is.OpenURL(*it_dl, 1,INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_DONT_CACHE);

}

catch([CException* e)
{
</code></pre>
<p>Was für ein Nachteil, oder auch nicht, ergibt sich, wenn ich nicht feingliedrig CFileExeption benutze, sondern die Vaterklasse CExeption ????</p>
<p>Danke und Grüße</p>
<p>BOA</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075858</guid><dc:creator><![CDATA[BOA]]></dc:creator><pubDate>Sun, 11 Jun 2006 20:08:18 GMT</pubDate></item><item><title><![CDATA[Reply to Die Sache mit den Exceptions on Sun, 11 Jun 2006 21:27:19 GMT]]></title><description><![CDATA[<p>Einen Nachteil gibt es so erstmal nicht, wenn es dir so genügt. Denn letztendlich mußt du selbst entscheiden, welchen Typ du abfängst. Denn CException kann sowohl CFileException als auch CInternetException sein. Spezialisierte Exceptions brauchst du nur dann abfangen, wenn du unterschiedlich drauf reagieren willst oder mußt. Dann wirst du aber instinktiv das hier machen:</p>
<pre><code class="language-cpp">try
{
}
catch(CInternetException *ex)
{
   // spzielle Behandlung bei CInternetException
}
catch(CException *ex)
{
   // Behandlung aller restlichen CExceptions.
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1075877</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075877</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Sun, 11 Jun 2006 21:27:19 GMT</pubDate></item><item><title><![CDATA[Reply to Die Sache mit den Exceptions on Mon, 12 Jun 2006 13:43:55 GMT]]></title><description><![CDATA[<p>Aloha,</p>
<p>*daumen hoch* <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>diese Struktur ist mir neu.</p>
<p>Ich kann also eine try - Anweisung und mehrere catch - Anweisungen dahinter packen ???</p>
<p>Klasse !</p>
<p>Danke und Grüße</p>
<p>BOA</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1076247</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1076247</guid><dc:creator><![CDATA[BOA]]></dc:creator><pubDate>Mon, 12 Jun 2006 13:43:55 GMT</pubDate></item></channel></rss>