Skip to content

Commit

Permalink
[portsyncd]: Add default catch block in portsyncd (#1033)
Browse files Browse the repository at this point in the history
* Add default catch block in portsyncd
* Updated error message with the right spelling
* Update try block to throw exception of type runtime_error
* Remove additional paranthesis in throw statement
  • Loading branch information
SuvarnaMeenakshi authored and stcheng committed Aug 22, 2019
1 parent dc81a21 commit 34915de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,15 @@ int main(int argc, char **argv)
}
catch (const std::exception& e)
{
cerr << "Exception \"" << e.what() << "\" had been thrown in deamon" << endl;
cerr << "Exception \"" << e.what() << "\" was thrown in daemon" << endl;
return EXIT_FAILURE;
}
catch (...)
{
cerr << "Exception was thrown in daemon" << endl;
return EXIT_FAILURE;
}


return 1;
}
Expand Down Expand Up @@ -224,7 +230,7 @@ void handlePortConfigFile(ProducerStateTable &p, string file, bool warm)
if (!infile.is_open())
{
usage();
throw "Port configuration file not found!";
throw runtime_error("Port configuration file not found!");
}

list<string> header = {"name", "lanes", "alias", "speed", "autoneg", "fec"};
Expand Down

0 comments on commit 34915de

Please sign in to comment.