Skip to content

Commit

Permalink
Print an exception description once catched. (sonic-net#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
garyachy authored and stcheng committed Aug 25, 2016
1 parent fa786a0 commit 0092243
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions fpmsyncd/fpmsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ int main(int argc, char **argv)
{
cout << "Connection lost, reconnecting..." << endl;
}
catch (...)
catch (const std::exception& e)
{
cout << "Exception had been thrown in deamon" << endl;
cout << "Exception \"" << e.what() << "\" had been thrown in deamon" << endl;
return 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions intfsyncd/intfsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ int main(int argc, char **argv)
s.select(&temps, &tempfd);
}
}
catch (...)
catch (const std::exception& e)
{
cout << "Exception had been thrown in deamon" << endl;
cout << "Exception \"" << e.what() << "\" had been thrown in deamon" << endl;
return 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions neighsyncd/neighsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ int main(int argc, char **argv)
s.select(&temps, &tempfd);
}
}
catch (...)
catch (const std::exception& e)
{
cout << "Exception had been thrown in deamon" << endl;
cout << "Exception \"" << e.what() << "\" had been thrown in deamon" << endl;
return 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ int main(int argc, char **argv)
}
}
}
catch (...)
catch (const std::exception& e)
{
cerr << "Exception had been thrown in deamon" << endl;
cerr << "Exception \"" << e.what() << "\" had been thrown in deamon" << endl;
return EXIT_FAILURE;
}

Expand Down
4 changes: 2 additions & 2 deletions teamsyncd/teamsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ int main(int argc, char **argv)
s.select(&temps, &tempfd);
}
}
catch (...)
catch (const std::exception& e)
{
cout << "Exception had been thrown in deamon" << endl;
cout << "Exception \"" << e.what() << "\" had been thrown in deamon" << endl;
return 0;
}
}
Expand Down

0 comments on commit 0092243

Please sign in to comment.