]> WPIA git - cassiopeia.git/blobdiff - src/util.cpp
Merge branch 'master' into libs/detectcoll/local
[cassiopeia.git] / src / util.cpp
index 40fcf25ac0dc2f5c9c6cbb3a6ab839404c20921d..30f87b77e1569b53bfc396cdbdb56d2676a2e230 100644 (file)
@@ -29,7 +29,7 @@ std::string writeBackFile( const std::string& serial, const std::string& cert, c
 
     if( 0 != mkdir( filename.c_str(), 0755 ) ) {
         if( EEXIST != errno ) {
-            return "";
+            throw std::runtime_error("Storage location could not be determined");
         }
 
         //! \FIXME: Check this is a directory
@@ -190,7 +190,7 @@ std::unique_ptr<std::ofstream> openLogfile( const std::string &name ) {
     auto res = std::make_unique<std::ofstream>( tname );
 
     if( ! res->good() ) {
-        throw std::string( "Failed to open file for logging: " ) + name;
+        throw std::runtime_error( std::string("Failed to open file for logging: " ) + name );
     }
 
     return res;