X-Git-Url: http://code.wpia.club/?a=blobdiff_plain;f=src%2Futil.cpp;h=30f87b77e1569b53bfc396cdbdb56d2676a2e230;hb=156855b7e12c3a0254590da514b0d0e8efe469f4;hp=d2667fad891951775a7d3abbb5cf89a76716fe15;hpb=709700dfbbeb5bf8aee1f5a1966f0192d783ae03;p=cassiopeia.git diff --git a/src/util.cpp b/src/util.cpp index d2667fa..30f87b7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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 @@ -187,10 +187,10 @@ std::unique_ptr openLogfile( const std::string &name ) { tname = name + "_" + std::to_string( ctr++ ); } - auto res = make_unique( tname ); + auto res = std::make_unique( 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;