aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi_mp.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-12 19:25:10 -0400
committerJack Lloyd <[email protected]>2018-08-12 19:25:10 -0400
commit2ddb3656d721f22c912e428b6c6a6af9398fbed9 (patch)
tree67adfc988ffeaf68725d01b88d49711a7203212b /src/lib/ffi/ffi_mp.cpp
parente0a43a200901e9c212573b09730c142b42c5719e (diff)
Better error reporting for FFI
Previously safe_get(x) where x was null would return an error about an exception being thrown, instead of a null pointer error.
Diffstat (limited to 'src/lib/ffi/ffi_mp.cpp')
-rw-r--r--src/lib/ffi/ffi_mp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi_mp.cpp b/src/lib/ffi/ffi_mp.cpp
index cbd784d7a..17d5d19c7 100644
--- a/src/lib/ffi/ffi_mp.cpp
+++ b/src/lib/ffi/ffi_mp.cpp
@@ -114,7 +114,7 @@ int botan_mp_to_str(const botan_mp_t mp, uint8_t digit_base, char* out, size_t*
else if(digit_base == 16)
base = Botan::BigInt::Hexadecimal;
else
- throw FFI_Error("botan_mp_to_str invalid digit base");
+ throw FFI_Error("botan_mp_to_str invalid digit base", BOTAN_FFI_ERROR_BAD_PARAMETER);
std::vector<uint8_t> hex = Botan::BigInt::encode(bn, base);
hex.push_back(0); // null terminator