generator: change exit(1) -> throw
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-30 00:00:20 +01:00
parent df4c9d7bdb
commit 01238c805a
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -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