diff options
Diffstat (limited to 'src/lib/utils/parsing.cpp')
-rw-r--r-- | src/lib/utils/parsing.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/utils/parsing.cpp b/src/lib/utils/parsing.cpp index ff8d5f0fb..36b168290 100644 --- a/src/lib/utils/parsing.cpp +++ b/src/lib/utils/parsing.cpp @@ -10,12 +10,20 @@ #include <botan/charset.h> #include <botan/get_byte.h> #include <set> +#include <stdexcept> namespace Botan { u32bit to_u32bit(const std::string& str) { - return std::stoul(str, nullptr); + try + { + return std::stoul(str, nullptr); + } + catch(std::exception&) + { + throw std::runtime_error("Could not read '" + str + "' as decimal string"); + } } /* |