From: James Turner Date: Mon, 22 Feb 2016 19:27:03 +0000 (+0200) Subject: HTTP repository: replace an assert. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d4384422f49d03aed394a9da9ecd3be4da304cb5;p=simgear.git HTTP repository: replace an assert. - Torsten is seeing this on his setup. --- diff --git a/simgear/io/HTTPRepository.cxx b/simgear/io/HTTPRepository.cxx index fc0913df..cd354d1c 100644 --- a/simgear/io/HTTPRepository.cxx +++ b/simgear/io/HTTPRepository.cxx @@ -633,7 +633,10 @@ HTTPRepository::failure() const // dir index data has changed, so write to disk and update // the hash accordingly std::ofstream of(pathInRepo().c_str(), std::ios::trunc | std::ios::out); - assert(of.is_open()); + if (!of.is_open()) { + throw sg_io_exception("Failed to open directory index file for writing", pathInRepo().c_str()); + } + of.write(body.data(), body.size()); of.close(); directory->dirIndexUpdated(hash);