Commit 8416c5d6 authored by Dick Hollenbeck's avatar Dick Hollenbeck

Add diagnostic message for missing *.kiface, which is now a fatal installation bug.

parent 32a9a4a4
...@@ -183,6 +183,24 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad ) ...@@ -183,6 +183,24 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
// In any of the failure cases above, dso.Unload() should be called here // In any of the failure cases above, dso.Unload() should be called here
// by dso destructor. // by dso destructor.
// However:
// There is a file installation bug. We only look for KIFACE_I's which we know
// to exist, and we did not find one. If we do not find one, this is an
// installation bug.
wxString msg = wxString::Format( wxT(
"Fatal Installation Bug\nmissing file:\n'%s'\n\nargv[0]:\n'%s'" ),
GetChars( dname ),
GetChars( wxStandardPaths::Get().GetExecutablePath() )
);
// This is a fatal error, one from which we cannot recover, nor do we want
// to protect against in client code which would require numerous noisy
// tests in numerous places. So we inform the user that the installation
// is bad. This exception will likely not get caught until way up in
// PGM_BASE or a derivative, at which point the process will exit gracefully.
THROW_IO_ERROR( msg );
} }
return NULL; return NULL;
......
...@@ -280,6 +280,30 @@ struct APP_KICAD : public wxApp ...@@ -280,6 +280,30 @@ struct APP_KICAD : public wxApp
return wxApp::OnExit(); return wxApp::OnExit();
} }
int OnRun() // overload wxApp virtual
{
try
{
return wxApp::OnRun();
}
catch( const std::exception& e )
{
wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
GetChars( FROM_UTF8( typeid(e).name() )),
GetChars( FROM_UTF8( e.what() ) ) );;
}
catch( const IO_ERROR& ioe )
{
wxLogError( GetChars( ioe.errorText ) );
}
catch(...)
{
wxLogError( wxT( "Unhandled exception of unknown type" ) );
}
return -1;
}
/** /**
* Function MacOpenFile * Function MacOpenFile
* is specific to MacOSX (not used under Linux or Windows). * is specific to MacOSX (not used under Linux or Windows).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment