diff options
author | Jack Lloyd <[email protected]> | 2016-09-17 17:18:10 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-07 22:21:37 -0400 |
commit | 2fdb81309f5d5dc138950facfdd94a2593236321 (patch) | |
tree | 0d5c976ce84dc23e7e8e8014b4021303554b9868 /src/tests/main.cpp | |
parent | fc03b27a44e83901a6fe319d783e2af41e162367 (diff) |
Add missing try/catch blocks.
Document that create_*_op is public but not for public consumption.
Diffstat (limited to 'src/tests/main.cpp')
-rw-r--r-- | src/tests/main.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/tests/main.cpp b/src/tests/main.cpp index b771d9614..d80049d53 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -312,14 +312,29 @@ int main(int argc, char* argv[]) BOTAN_VERSION_MINOR, BOTAN_VERSION_PATCH); - std::unique_ptr<Botan_CLI::Command> cmd(Botan_CLI::Command::get_cmd("test")); + try + { + std::unique_ptr<Botan_CLI::Command> cmd(Botan_CLI::Command::get_cmd("test")); - if(!cmd) + if(!cmd) + { + std::cout << "Unable to retrieve testing helper (program bug)\n"; // WTF + return 1; + } + + std::vector<std::string> args(argv + 1, argv + argc); + return cmd->run(args); + } + catch(Botan::Exception& e) { - std::cout << "Unable to retrieve testing helper (program bug)\n"; // WTF - return 1; + std::cout << "Exiting with library exception " << e.what() << std::endl; + } + catch(std::exception& e) + { + std::cout << "Exiting with std exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Exiting with unknown exception\n"; } - - std::vector<std::string> args(argv + 1, argv + argc); - return cmd->run(args); } |