<?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[Handling Exception: third party library]]></title><description><![CDATA[<p dir="auto">First of all, I read other posts about Qt and Exceptions (like <a href="https://forum.qt.io/topic/2294/exception-handling-throwing-exception-and-try-catch-blocks/22">this</a>), <strong>but I not found a solution to my case.</strong></p>
<p dir="auto">I'm using a third party C++ library called <strong>HighFive</strong> (github <a href="https://github.com/BlueBrain/HighFive" target="_blank" rel="noopener noreferrer nofollow ugc">link</a>) in <strong>my Qt GUI project</strong> to write and read data in HDF5 format.</p>
<p dir="auto"><strong>It's working. I can read and write data with this.</strong><br />
<strong>The problem is that:</strong> Every time when I try to read/write data using this library, <strong>the library emit a exception</strong> and Qt Creator IDE shows it <strong>in a GUI popup window and I can't catch it</strong> in a <code>try/catch</code> block.<br />
This simple example below is a completly new Qt Console application project created just to test the <code>try/catch</code> block:</p>
<pre><code>int main(int argc, char *argv[])
{
    QCoreApplication app(argc, argv);

    // Create a HDF5 file on disk:
    H5Easy::File file("test.h5", H5Easy::File::Overwrite);
    // Create some data:
    std::vector&lt;double&gt; data = { 1, 2, 3, 4, 5 };

    // Try to write data into the HDF5 file:
    try {
        H5Easy::dump(file, "/path/to/my/data", data);
    } catch (...) {
        qDebug() &lt;&lt; "I CATCH A EXCEPTION";
    }

    return app.exec();
}
</code></pre>
<p dir="auto">When the debugger <strong>hits the line:</strong></p>
<pre><code>H5Easy::dump(file, "/path/to/my/data", data);
</code></pre>
<p dir="auto">The debugger goes to a internal HighFive library file that emits the <strong>exception (GUI popup window):</strong><br />
<img src="https://ddgobkiprc33d.cloudfront.net/aab16919-cdd7-4cf8-aa4c-a5f26d6b37a4.png" alt="bf9f536a-179a-47b7-b1ba-39afc5e46405-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>What can I do inside my</strong> <code>main.cpp</code> <strong>to handle this exception and not get this popup window above?</strong></p>
<p dir="auto">PS.: I talked to the HighFive team about it. They asked me to test the same example using Microsoft Visual Studio 2019 and <strong>it works great without erros or exceptions.</strong> So they think that this case is about some <strong>special configuration on the Qt Creator IDE.</strong><br />
You can see the discussion <a href="https://github.com/BlueBrain/HighFive/issues/224" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto"><strong>My system:</strong></p>
<ul>
<li>Windows 10 x64</li>
<li>Qt Creator IDE 4.10.1 (32 bits)</li>
<li>Visual Studio 2019 Enterprise</li>
</ul>
<p dir="auto"><strong>Compiler and Debugger:</strong><br />
<img src="https://ddgobkiprc33d.cloudfront.net/0b74bc5c-35a5-4ffd-9c90-75ab877f2fa5.png" alt="69ce2c46-5b71-4cfc-a353-67317e6d7092-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>Again:</strong> All is working! I just want to "disable/mute" this exceptions or catch it in a <code>try/catch</code> block.<br />
<strong>How can I do that?</strong></p>
]]></description><link>https://forum.qt.io/topic/107889/handling-exception-third-party-library</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Mar 2026 07:08:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/107889.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Oct 2019 14:13:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Handling Exception: third party library on Tue, 22 Oct 2019 20:04:56 GMT]]></title><description><![CDATA[<p dir="auto">Are you talking about the Qt installation or the VS2019 one ?</p>
]]></description><link>https://forum.qt.io/post/557423</link><guid isPermaLink="true">https://forum.qt.io/post/557423</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 22 Oct 2019 20:04:56 GMT</pubDate></item><item><title><![CDATA[Reply to Handling Exception: third party library on Tue, 22 Oct 2019 19:26:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> yes...the installation was clear and it said nothing about the compiler/debugger name or type.<br />
It was like: Next, next, next, finish..<strong>.done!</strong></p>
]]></description><link>https://forum.qt.io/post/557417</link><guid isPermaLink="true">https://forum.qt.io/post/557417</guid><dc:creator><![CDATA[fem_dev]]></dc:creator><pubDate>Tue, 22 Oct 2019 19:26:38 GMT</pubDate></item><item><title><![CDATA[Reply to Handling Exception: third party library on Tue, 22 Oct 2019 17:21:22 GMT]]></title><description><![CDATA[<p dir="auto">As I said, things may have changed with VS2019. Do you remember its installation ?</p>
]]></description><link>https://forum.qt.io/post/557396</link><guid isPermaLink="true">https://forum.qt.io/post/557396</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 22 Oct 2019 17:21:22 GMT</pubDate></item><item><title><![CDATA[Reply to Handling Exception: third party library on Mon, 21 Oct 2019 13:50:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> Well...I don't know...<br />
I was thinking that this debugger (image above in red) is the VS 2019 debugger and Qt is using the same debugger.</p>
<pre><code>C:\ Program Files (x86)\Wnidows Kits\10\Debuggers\x64\cdb.exe
</code></pre>
<p dir="auto"><strong>Is it not the same?</strong></p>
]]></description><link>https://forum.qt.io/post/557174</link><guid isPermaLink="true">https://forum.qt.io/post/557174</guid><dc:creator><![CDATA[fem_dev]]></dc:creator><pubDate>Mon, 21 Oct 2019 13:50:04 GMT</pubDate></item><item><title><![CDATA[Reply to Handling Exception: third party library on Fri, 18 Oct 2019 18:08:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">One thing that is indeed different is the debugger. Unless it changed recently, the Visual Studio debugger was only available to Visual Studio itself. You had to install a standalone debugger which might be different that the one embedded in Visual Studio.</p>
]]></description><link>https://forum.qt.io/post/556907</link><guid isPermaLink="true">https://forum.qt.io/post/556907</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 18 Oct 2019 18:08:33 GMT</pubDate></item></channel></rss>