Make message from wxApp::OnUnhandledException() more clear

This message now appears even in the (default) release builds as __WXDEBUG__
is always defined, so it needs to be at least somewhat understandable by
normal users, even if it remains primarily targeted at the developers.

Also remove __WXDEBUG__ checks in this function, this is a left-over from the
pre-3.0 debug mode.
This commit is contained in:
Vadim Zeitlin
2016-07-02 16:21:20 +02:00
parent b8ff711460
commit bf083479d5

View File

@@ -673,7 +673,6 @@ void wxAppConsoleBase::CallEventHandler(wxEvtHandler *handler,
void wxAppConsoleBase::OnUnhandledException() void wxAppConsoleBase::OnUnhandledException()
{ {
#ifdef __WXDEBUG__
// we're called from an exception handler so we can re-throw the exception // we're called from an exception handler so we can re-throw the exception
// to recover its type // to recover its type
wxString what; wxString what;
@@ -685,9 +684,9 @@ void wxAppConsoleBase::OnUnhandledException()
catch ( std::exception& e ) catch ( std::exception& e )
{ {
#ifdef wxNO_RTTI #ifdef wxNO_RTTI
what.Printf("std::exception, what() = \"%s\"", e.what()); what.Printf("standard exception with message \"%s\"", e.what());
#else #else
what.Printf("std::exception of type \"%s\", what() = \"%s\"", what.Printf("standard exception of type \"%s\" with message \"%s\"",
typeid(e).name(), e.what()); typeid(e).name(), e.what());
#endif #endif
} }
@@ -698,9 +697,8 @@ void wxAppConsoleBase::OnUnhandledException()
} }
wxMessageOutputBest().Printf( wxMessageOutputBest().Printf(
"*** Caught unhandled %s; terminating\n", what "Unhandled %s; terminating\n", what
); );
#endif // __WXDEBUG__
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------