What exception is thrown that I catch with a catch(..)?
-
Hi Does anyone know how I can find out what exception has actualy been thrown when I catch it with catch (...) block. /Per
-
Hi Does anyone know how I can find out what exception has actualy been thrown when I catch it with catch (...) block. /Per
-
all the other exceptions that has not been catched with previous catch block. you can imagine its behavior like the default statement of a switch...
TOXCCT >>> GEII power
[toxcct][VisualCalc]I woul'd like to catch the exception, but I don't know what type it is. Can I figure that out in some way?
-
I woul'd like to catch the exception, but I don't know what type it is. Can I figure that out in some way?
-
I don't think so either. In cases where you specify the exception type, you can do something like catch(CexType& ex) and that gives you an object you can interrogate, perhaps using RTTI, but in the ellipsis case, there's nothing to help you. Steve S Developer for hire
-
Hi Does anyone know how I can find out what exception has actualy been thrown when I catch it with catch (...) block. /Per
Most frameworks provide a base class that all exceptions should be derived from for this reason. For example MFC has a CException class. In all but the most exceptional (pun intended) circumstances exceptions should derive from std::exception, the exception base class for the C++ Standard library. Rather than catch(...), use catch(std::exception& )
If you can keep you head when all about you Are losing theirs and blaming it on you; If you can dream - and not make dreams your master; If you can think - and not make thoughts your aim; Yours is the Earth and everything that's in it. Rudyard Kipling