J
Jacek Dziedzic
Hi!
In my main() function I have a last-resort exception construct that
looks
like this:
int main() {
try {
// ... program code
}
catch(...) { // catch every exception
std::cout << "An exception occured!" << std::endl;
};
};
It works fine, but I never know *which* exception has occured.
I seem to remember you can catch an exception object rather than
an exception class, and then, having the precise object you could
get the name that's stored somewhere inside it. But the "..." seems
to get in the way for me. Is there a way to catch a precise exception
object with catch(...)? Or a workaround for that?
tia,
- J.
In my main() function I have a last-resort exception construct that
looks
like this:
int main() {
try {
// ... program code
}
catch(...) { // catch every exception
std::cout << "An exception occured!" << std::endl;
};
};
It works fine, but I never know *which* exception has occured.
I seem to remember you can catch an exception object rather than
an exception class, and then, having the precise object you could
get the name that's stored somewhere inside it. But the "..." seems
to get in the way for me. Is there a way to catch a precise exception
object with catch(...)? Or a workaround for that?
tia,
- J.