diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2015-05-31 18:32:02 +0200 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2015-05-31 18:32:02 +0200 |
commit | 47b597cef4d17301ee5ab8e8b8ac2d336787a635 (patch) | |
tree | dfbcc4d2a0c6720b89a2d95efb099c66b3e965f7 | |
parent | 6d0108a8e38d8a6e4abe78343c752a14637199cb (diff) |
exception safety
-rw-r--r-- | src/common.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/common.cpp b/src/common.cpp index 7287ca0..05f6fb3 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -137,7 +137,18 @@ getDateString() const boost::posix_time::ptime now=boost::posix_time::second_clock::local_time(); boost::posix_time::time_facet*const f=new boost::posix_time::time_facet("%Y_%m_%d_%H_%M_%S"); msg.imbue(std::locale(msg.getloc(),f)); - msg << now; + try + { + msg << now; + } + catch(boost::exception &e) + { + std::cerr << boost::diagnostic_information(e) << std::endl; + } + catch(std::exception& e) + { + std::cerr << e.what() << std::endl; + } return msg.str(); } |