fs/io/GzipOutputStream: use C++ exceptions in constructor

This commit is contained in:
Max Kellermann
2015-12-16 10:14:56 +01:00
parent 7eae3bc8c5
commit 36d6ead65c
7 changed files with 92 additions and 33 deletions

View File

@@ -386,10 +386,7 @@ SimpleDatabase::Save(Error &error)
#ifdef ENABLE_ZLIB
std::unique_ptr<GzipOutputStream> gzip;
if (compress) {
gzip.reset(new GzipOutputStream(*os, error));
if (!gzip->IsDefined())
return false;
gzip.reset(new GzipOutputStream(*os));
os = gzip.get();
}
#endif