Display a nice error message instead of asserting

When we mess up, it will be nice to not lose users' data.  This requests
a bug report if the netlist parsing breaks instead of throwing
This commit is contained in:
Seth Hillbrand 2021-09-01 12:02:06 -07:00
parent 8a305eec32
commit e0011fcd93
1 changed files with 8 additions and 2 deletions

View File

@ -1451,10 +1451,16 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist,
KICAD_NETLIST_READER netlistReader( lineReader, &aNetlist );
netlistReader.LoadNetlist();
}
catch( const IO_ERROR& )
catch( const IO_ERROR& e )
{
Raise();
assert( false ); // should never happen
// Do not translate extra_info strings. These are for developers
wxString extra_info = e.Problem() + " : " + e.What() + " at " + e.Where();
DisplayErrorMessage( this, _( "Received an error while reading netlist. Please "
"report this issue to the KiCad team using the menu "
"Help->Report Bug."), extra_info );
return false;
}