Skip to content

Commit

Permalink
Use qCritical() for uncaught exceptions, allows backtrace to be dumpe…
Browse files Browse the repository at this point in the history
…d when these are encountered
  • Loading branch information
nyalldawson committed Sep 22, 2020
1 parent 950d2bd commit 9d885af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsapplication.cpp
Expand Up @@ -448,19 +448,19 @@ bool QgsApplication::notify( QObject *receiver, QEvent *event )
}
catch ( QgsException &e )
{
QgsDebugMsg( "Caught unhandled QgsException: " + e.what() );
qCritical() << "Caught unhandled QgsException: " << e.what();
if ( qApp->thread() == QThread::currentThread() )
QMessageBox::critical( activeWindow(), tr( "Exception" ), e.what() );
}
catch ( std::exception &e )
{
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromLatin1( e.what() ) );
qCritical() << "Caught unhandled std::exception: " << e.what();
if ( qApp->thread() == QThread::currentThread() )
QMessageBox::critical( activeWindow(), tr( "Exception" ), e.what() );
}
catch ( ... )
{
QgsDebugMsg( QStringLiteral( "Caught unhandled unknown exception" ) );
qCritical() << "Caught unhandled unknown exception";
if ( qApp->thread() == QThread::currentThread() )
QMessageBox::critical( activeWindow(), tr( "Exception" ), tr( "unknown exception" ) );
}
Expand Down

0 comments on commit 9d885af

Please sign in to comment.