More informative error message in Hurricane::Net constructor.

This commit is contained in:
Jean-Paul Chaput 2020-11-02 17:16:02 +01:00
parent f9cd0e2565
commit afa5fcd4c7
1 changed files with 5 additions and 8 deletions

View File

@ -269,14 +269,11 @@ Net::Net(Cell* cell, const Name& name)
_nextOfCellNetMap(NULL), _nextOfCellNetMap(NULL),
_mainName(this) _mainName(this)
{ {
if (!_cell) if (not _cell) throw Error( "Net::Net(): Can't create Hurricane::Net, NULL cell" );
throw Error("Can't create " + _TName("Net") + " : null cell"); if (name.isEmpty()) throw Error( "Net::Net(): Can't create Hurricane::Net, empty name" );
if (name.isEmpty())
throw Error("Can't create " + _TName("Net") + " : empty name");
if (_cell->getNet(_name)) if (_cell->getNet(_name))
throw Error("Can't create " + _TName("Net ") + getString(_name) + " : already exists"); throw Error( "Net::Net(): Can't create Hurricane::Net named \""+getString(_name)+"\""
+ " in Cell \""+getString(_cell->getName())+"\", already exists");
} }
Net* Net::create(Cell* cell, const Name& name) Net* Net::create(Cell* cell, const Name& name)