1
0

utils: readCompleteFile(): Throw exception if file can't be opened

Este cometimento está contido em:
Albert S. 2022-03-27 19:47:52 +02:00
ascendente f7cf06cdd5
cometimento 16c352c6af

Ver ficheiro

@ -138,6 +138,10 @@ std::string utils::readCompleteFile(std::string_view filepath)
{
std::fstream stream(std::string{filepath});
if(!stream.is_open())
{
throw std::runtime_error("stream is not open");
}
std::stringstream ss;
ss << stream.rdbuf();
std::string content = ss.str();