diff --git a/src/utils.cc b/src/utils.cc index c98658ac..ce6588b8 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -456,15 +456,14 @@ void UpdateTestExpectation(const std::string& filename, of.close(); } -void Fail(const std::string& message) { - LOG_S(FATAL) << "Fatal error: " << message; - std::exit(1); -} - void WriteToFile(const std::string& filename, const std::string& content) { std::ofstream file(filename, std::ios::out | std::ios::trunc | std::ios::binary); - assert(file.good()); + if (!file.good()) { + LOG_S(ERROR) << "Cannot write to " << filename; + return; + } + file << content; } diff --git a/src/utils.h b/src/utils.h index a1e63293..c4d991ce 100644 --- a/src/utils.h +++ b/src/utils.h @@ -99,8 +99,6 @@ void UpdateTestExpectation(const std::string& filename, const std::string& expectation, const std::string& actual); -void Fail(const std::string& message); - void WriteToFile(const std::string& filename, const std::string& content); // note: this implementation does not disable this overload for array types