diff --git a/src/transfer_function.hh b/src/transfer_function.hh index 2e4efaf..15846e4 100644 --- a/src/transfer_function.hh +++ b/src/transfer_function.hh @@ -225,6 +225,12 @@ public: << std::endl; } } + if (ofs.fail()) { + std::string message = "Could not write to file: " + fname; + music::elog << message << std::endl; + throw std::runtime_error(message); + } + ofs.close(); } }