Getting information about where c++ exceptions are thrown inside of catch block?

后端 未结 5 1527
误落风尘
误落风尘 2020-12-13 23:02

I\'ve got a c++ app that wraps large parts of code in try blocks. When I catch exceptions I can return the user to a stable state, which is nice. But I\'m not longer recei

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 23:43

    You can write dumps using MiniDumpWriteDump function.

    If you're using C++ exceptions, then you can simply include file/line/function information (so you'll see it as text if you call std::exception.what()) in any place where you throw that exception (using ____FUNCTION____, ____FILE____ and ____LINE____ macros).

    If you're trying to catch OS exceptions, then crashing the application will be probably a better choice.

提交回复
热议问题