How to get information in unhandled exception

Discussion in 'C++' started by Angus, Apr 10, 2008.

  1. Angus

    Angus Guest

    Hello

    I have some code which throws an exception like this:

    try
    {
    BadFunc();
    }
    catch(std::exception& e)
    {
    DebugLog << "MyClass::MyFunc() exception: " << e.what() << endl;
    }
    catch(...)
    {
    DebugLog << "MyClass::MyFunc() unhandled exception" << endl;
    }

    How can I get details of what might have caused the unhanlded
    exception?
    Angus, Apr 10, 2008
    #1
    1. Advertising

  2. Angus

    James Kanze Guest

    On Apr 10, 8:03 pm, Angus <> wrote:

    > I have some code which throws an exception like this:


    > try
    > {
    > BadFunc();}


    > catch(std::exception& e)
    > {
    > DebugLog << "MyClass::MyFunc() exception: " << e.what() << endl;}


    > catch(...)
    > {
    > DebugLog << "MyClass::MyFunc() unhandled exception" << endl;
    > }


    > How can I get details of what might have caused the unhanlded
    > exception?


    You can't. The compiler (or rather the runtime library)
    obviously have this information available somewhere, but to
    date, no one has come up with a reasonable interface to access
    it.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Apr 11, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amit
    Replies:
    8
    Views:
    3,766
    Alan Pretre
    Aug 4, 2003
  2. Ola
    Replies:
    0
    Views:
    519
  3. Tedka
    Replies:
    2
    Views:
    2,653
    Mr. Dot Net
    Jul 19, 2004
  4. Warren Tang
    Replies:
    1
    Views:
    861
    Warren Tang
    Sep 23, 2008
  5. Angus
    Replies:
    4
    Views:
    393
    James Kanze
    May 20, 2009
Loading...

Share This Page