diff options
author | Jack Lloyd <[email protected]> | 2015-12-11 09:42:06 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-12-11 09:42:06 -0500 |
commit | 6b9a3a534071ef84c121c406559f8fc7ad546104 (patch) | |
tree | c11480ad1f07e443ba4e992fefcd618b532c2e93 /src/lib/compression/compression.cpp | |
parent | 79a51627ee11f4d7f55d589751b30463d1f02a76 (diff) |
Reroot the exception hierarchy into a toplevel Exception class
As the alternatives are unfortunate for applications trying to catch
all library errors, and it seems deriving from std::runtime_error
causes problems with MSVC DLLs (GH #340)
Effectively reverts 2837e915d82e43
Diffstat (limited to 'src/lib/compression/compression.cpp')
-rw-r--r-- | src/lib/compression/compression.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/compression/compression.cpp b/src/lib/compression/compression.cpp index ddbcd7cec..fc2c6192a 100644 --- a/src/lib/compression/compression.cpp +++ b/src/lib/compression/compression.cpp @@ -28,7 +28,7 @@ void Compression_Alloc_Info::do_free(void* ptr) auto i = m_current_allocs.find(ptr); if(i == m_current_allocs.end()) - throw std::runtime_error("Compression_Alloc_Info::free got pointer not allocated by us"); + throw Exception("Compression_Alloc_Info::free got pointer not allocated by us"); zero_mem(ptr, i->second); std::free(ptr); @@ -64,7 +64,7 @@ Compressor_Transform* do_make_compressor(const std::string& type, const std::str Compressor_Transform* r = dynamic_cast<Compressor_Transform*>(t.get()); if(!r) - throw std::runtime_error("Bad cast of compression object " + t_name); + throw Exception("Bad cast of compression object " + t_name); t.release(); return r; @@ -228,7 +228,7 @@ void Stream_Decompression::finish(secure_vector<byte>& buf, size_t offset) process(buf, offset, m_stream->finish_flag()); if(m_stream.get()) - throw std::runtime_error(name() + " finished but not at stream end"); + throw Exception(name() + " finished but not at stream end"); } } |