Qt/C++ Error handling

Posted by ShiGon on Stack Overflow See other posts from Stack Overflow or by ShiGon
Published on 2011-01-11T19:46:55Z Indexed on 2011/01/11 19:54 UTC
Read the original article Hit count: 219

Filed under:
|
|

I've been doing a lot of research about handling errors with Qt/C++ and I'm still as lost as when I started. Maybe I'm looking for an easy way out (like other languages provide). One, in particular, provides for an unhandled exception which I use religiously. When the program encounters a problem, it throws the unhandled exception so that I can create my own error report. That report gets sent from my customers machine to a server online which I then read later.

The problem that I'm having with C++ is that any error handling that's done has to be thought of BEFORE hand (think try/catch or massive conditionals). In my experience, problems in code are not thought of before hand else there wouldn't be a problem to begin with.

Writing a cross-platform application without a cross-platform error handling/reporting/trace mechanism is a little scary to me.

My question is: Is there any kind of Qt or C++ Specific "catch-all" error trapping mechanism that I can use in my application so that, if something does go wrong I can, at least, write a report before it crashes?

© Stack Overflow or respective owner

Related posts about c++

Related posts about qt