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/misc/fpe_fe1 | |
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/misc/fpe_fe1')
-rw-r--r-- | src/lib/misc/fpe_fe1/fpe_fe1.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/misc/fpe_fe1/fpe_fe1.cpp b/src/lib/misc/fpe_fe1/fpe_fe1.cpp index f2502014b..bc14c425c 100644 --- a/src/lib/misc/fpe_fe1/fpe_fe1.cpp +++ b/src/lib/misc/fpe_fe1/fpe_fe1.cpp @@ -57,7 +57,7 @@ void factor(BigInt n, BigInt& a, BigInt& b) std::swap(a, b); if(a <= 1 || b <= 1) - throw std::runtime_error("Could not factor n for use in FPE"); + throw Exception("Could not factor n for use in FPE"); } /* @@ -100,7 +100,7 @@ FPE_Encryptor::FPE_Encryptor(const SymmetricKey& key, std::vector<byte> n_bin = BigInt::encode(n); if(n_bin.size() > MAX_N_BYTES) - throw std::runtime_error("N is too large for FPE encryption"); + throw Exception("N is too large for FPE encryption"); mac->update_be(static_cast<u32bit>(n_bin.size())); mac->update(n_bin.data(), n_bin.size()); |