From 01238c805a8dac5bb95fe459ddcde1c12f1caa82 Mon Sep 17 00:00:00 2001 From: surtur Date: Sun, 30 Jan 2022 00:00:20 +0100 Subject: [PATCH] generator: change exit(1) -> throw --- generator.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generator.cpp b/generator.cpp index 52ed7ac..b3a84f3 100644 --- a/generator.cpp +++ b/generator.cpp @@ -27,7 +27,7 @@ Generator::Generator() /*noexcept*/ { } catch (CryptoPP::Exception& e) { fmt::print(stderr, "{}\n", e.what()); - exit(1); + throw; } } Generator::~Generator() noexcept {} @@ -43,7 +43,7 @@ void Generator::initialize_generator() { } catch (CryptoPP::Exception& e) { fmt::print(stderr, "{}\n", e.what()); - exit(1); + throw; } } @@ -79,6 +79,7 @@ auto Generator::reseed(const std::string& s) -> void { } catch (std::exception& e) { fmt::print("{}", e.what()); + throw; } } @@ -121,7 +122,7 @@ auto Generator::do_crypto() -> std::string { } catch (CryptoPP::Exception& e) { fmt::print(stderr, "{}\n", e.what()); - exit(1); + throw; } // Pretty print cipher text