Skip to content

Commit

Permalink
Made sure that the library components crash loudly when exception occ…
Browse files Browse the repository at this point in the history
…urrs
  • Loading branch information
victorjarlow committed Mar 31, 2022
1 parent 6d3854a commit 523887a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
10 changes: 9 additions & 1 deletion appln/main_xodr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ int main (int argc , char **argv)

xodr _odrive;
_odrive.load(filename);
_odrive.parse();

try{
_odrive.parse();
std::cout << "OpenDRIVE parse successfully " << _odrive.m_OpenDRIVE<< std::endl;
}
catch (std::exception &e)
{
std::cout << "ERROR :Exception .. " << e.what() << std::endl;
}

_odrive.save("xodr_save.xml");

Expand Down
9 changes: 8 additions & 1 deletion appln/main_xosc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ int main (int argc , char **argv)

xosc _osc;
_osc.load(filename);
_osc.parse();
try{
_osc.parse();
std::cout << "OpenSCENARIO parse successfully " << _osc.m_OpenSCENARIO<< std::endl;
}
catch (std::exception &e)
{
std::cout << "ERROR :Exception .. " << e.what() << std::endl;
}

_osc.save("xosc_save.xml");

Expand Down
9 changes: 1 addition & 8 deletions src/xodr/xodr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2011,14 +2011,7 @@ void xodr::load(std::string xodrfilename )
}
void xodr::parse()
{
try {
m_OpenDRIVE = std::make_shared<OpenDRIVE>(m_root.child("OpenDRIVE"));
std::cout << "OpenDRIVE parse successfully " << m_OpenDRIVE<< std::endl;
}
catch (std::exception &e)
{
std::cout << "ERROR :Exception .. " << e.what() << std::endl;
}
m_OpenDRIVE = std::make_shared<OpenDRIVE>(m_root.child("OpenDRIVE"));
}
void xodr::save(std::string filename)
{
Expand Down
9 changes: 1 addition & 8 deletions src/xosc/xosc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3428,14 +3428,7 @@ void xosc::load(std::string xoscfilename )
}
void xosc::parse()
{
try {
m_OpenSCENARIO = std::make_shared<OpenSCENARIO>(m_root.child("OpenSCENARIO"));
std::cout << "OpenSCENARIO parse successfully " << m_OpenSCENARIO<< std::endl;
}
catch (std::exception &e)
{
std::cout << "ERROR :Exception .. " << e.what() << std::endl;
}
m_OpenSCENARIO = std::make_shared<OpenSCENARIO>(m_root.child("OpenSCENARIO"));
}
void xosc::save(std::string filename)
{
Expand Down

0 comments on commit 523887a

Please sign in to comment.