More consistency in error messages.

This commit is contained in:
Jeff Young 2022-10-11 11:00:29 +01:00
parent d47752ad75
commit 8a9e92bc01
1 changed files with 9 additions and 12 deletions

View File

@ -57,8 +57,8 @@ bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow()
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
DisplayError( this, wxString::Format( _( "Error occurred writing empty symbol library " DisplayError( this, wxString::Format( _( "Error creating symbol library table '%s'.\n"
"table.\n\n%s" ), "%s" ),
SYMBOL_LIB_TABLE::GetGlobalTableFileName(), SYMBOL_LIB_TABLE::GetGlobalTableFileName(),
ioe.What() ) ); ioe.What() ) );
return false; return false;
@ -93,7 +93,8 @@ bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow()
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
DisplayError( this, wxString::Format( _( "'%s' is not a valid symbol library table.\n\n%s" ), DisplayError( this, wxString::Format( _( "Error reading symbol library table '%s'.\n"
"%s" ),
fn.GetFullPath(), fn.GetFullPath(),
ioe.What() ) ); ioe.What() ) );
return false; return false;
@ -104,7 +105,7 @@ bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow()
if( !symTableFileName.DirExists() && !symTableFileName.Mkdir( 0x777, wxPATH_MKDIR_FULL ) ) if( !symTableFileName.DirExists() && !symTableFileName.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
{ {
DisplayError( this, wxString::Format( _( "Cannot create global library table path '%s'." ), DisplayError( this, wxString::Format( _( "Cannot create global library table '%s'." ),
symTableFileName.GetPath() ) ); symTableFileName.GetPath() ) );
return false; return false;
} }
@ -112,16 +113,15 @@ bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow()
// Copy the global symbol library table file to the user config. // Copy the global symbol library table file to the user config.
if( !::wxCopyFile( fn.GetFullPath(), symTableFileName.GetFullPath() ) ) if( !::wxCopyFile( fn.GetFullPath(), symTableFileName.GetFullPath() ) )
{ {
DisplayError( this, wxString::Format( _( "Cannot copy global symbol library table file " DisplayError( this, wxString::Format( _( "Error copying global symbol library table '%s' "
"'%s' to '%s'." ), "to '%s'." ),
fn.GetFullPath(), fn.GetFullPath(),
symTableFileName.GetFullPath() ) ); symTableFileName.GetFullPath() ) );
return false; return false;
} }
// Load the successfully copied symbol library table file. This should not fail // Load the successfully copied symbol library table file. This should not fail since the
// since the file was tested above. Check for failure anyway to keep the compiler // file was tested above. Check for failure anyway to keep the compiler from complaining.
// from complaining.
try try
{ {
if( !SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE::GetGlobalLibTable() ) ) if( !SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE::GetGlobalLibTable() ) )
@ -129,9 +129,6 @@ bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow()
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
DisplayError( this, wxString::Format( _( "Error loading global symbol library table."
"\n\n%s" ),
ioe.What() ) );
return false; return false;
} }