Move 3 more blocks to the common ex handler

This commit is contained in:
Marek Roszko 2023-04-19 21:17:31 -04:00
parent 18ac4c2288
commit d97de297af
2 changed files with 3 additions and 30 deletions

View File

@ -452,18 +452,9 @@ KIWAY_PLAYER* KIWAY::Player( FRAME_T aFrameType, bool doCreate, wxTopLevelWindow
m_playerFrameId[aFrameType].store( frame->GetId() ); m_playerFrameId[aFrameType].store( frame->GetId() );
return frame; return frame;
} }
catch( const IO_ERROR& ioe )
{
wxLogError( ioe.What() );
wxLogError( _( "Error loading editor." ) );
}
catch( const std::exception& e )
{
wxLogError( e.what() );
wxLogError( _( "Error loading editor." ) );
}
catch( ... ) catch( ... )
{ {
Pgm().HandleException( std::current_exception() );
wxLogError( _( "Error loading editor." ) ); wxLogError( _( "Error loading editor." ) );
} }
} }

View File

@ -479,18 +479,9 @@ struct APP_KICAD_CLI : public wxAppConsole
{ {
return program.OnPgmRun(); return program.OnPgmRun();
} }
catch( const std::exception& e )
{
wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
FROM_UTF8( typeid( e ).name() ), FROM_UTF8( e.what() ) );
}
catch( const IO_ERROR& ioe )
{
wxFprintf( stderr, ioe.What() );
}
catch( ... ) catch( ... )
{ {
wxLogError( wxT( "Unhandled exception of unknown type" ) ); Pgm().HandleException( std::current_exception() );
} }
return -1; return -1;
@ -560,18 +551,9 @@ struct APP_KICAD_CLI : public wxAppConsole
{ {
throw; throw;
} }
catch( const std::exception& e )
{
wxLogError( "Unhandled exception class: %s what: %s", FROM_UTF8( typeid( e ).name() ),
FROM_UTF8( e.what() ) );
}
catch( const IO_ERROR& ioe )
{
wxLogError( ioe.What() );
}
catch( ... ) catch( ... )
{ {
wxLogError( "Unhandled exception of unknown type" ); Pgm().HandleException( std::current_exception() );
} }
return false; // continue on. Return false to abort program return false; // continue on. Return false to abort program