[Pkg-running-devel] [antpm] 07/20: exception safety

Kristof Ralovich ralovich-guest at moszumanska.debian.org
Sun Jun 28 12:26:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

ralovich-guest pushed a commit to branch upstream
in repository antpm.

commit 47b597cef4d17301ee5ab8e8b8ac2d336787a635
Author: RALOVICH, Kristof <tade60 at freemail.hu>
Date:   Sun May 31 18:32:02 2015 +0200

    exception safety
---
 src/common.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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();
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/antpm.git



More information about the Pkg-running-devel mailing list