aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/cli_exceptions.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-24 13:59:17 -0400
committerJack Lloyd <[email protected]>2017-10-24 13:59:17 -0400
commit7edec05c6056ab890a70eaf9f5c7a73321581ede (patch)
tree4de2627ea54b94e238268f4a26c78acf37e97a23 /src/cli/cli_exceptions.h
parentec4f5f1aa187a5416a43f10ae5afa5da137f99ae (diff)
parent08ffc1a49bb0f1a1a42a57d7c55bbf0d9b6b8336 (diff)
Merge GH #1273 Refactor test and cli runner code
Diffstat (limited to 'src/cli/cli_exceptions.h')
-rw-r--r--src/cli/cli_exceptions.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/cli/cli_exceptions.h b/src/cli/cli_exceptions.h
new file mode 100644
index 000000000..ed7be3137
--- /dev/null
+++ b/src/cli/cli_exceptions.h
@@ -0,0 +1,44 @@
+/*
+* (C) 2015 Jack Lloyd
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#ifndef BOTAN_CLI_EXCEPTIONS_H_
+#define BOTAN_CLI_EXCEPTIONS_H_
+
+namespace Botan_CLI {
+
+class CLI_Error : public std::runtime_error
+ {
+ public:
+ explicit CLI_Error(const std::string& s) : std::runtime_error(s) {}
+ };
+
+class CLI_IO_Error : public CLI_Error
+ {
+ public:
+ CLI_IO_Error(const std::string& op, const std::string& who) :
+ CLI_Error("Error " + op + " " + who) {}
+ };
+
+class CLI_Usage_Error : public CLI_Error
+ {
+ public:
+ explicit CLI_Usage_Error(const std::string& what) : CLI_Error(what) {}
+ };
+
+/* Thrown eg when a requested feature was compiled out of the library
+ or is not available, eg hashing with
+*/
+class CLI_Error_Unsupported : public CLI_Error
+ {
+ public:
+ CLI_Error_Unsupported(const std::string& what,
+ const std::string& who)
+ : CLI_Error(what + " with '" + who + "' unsupported or not available") {}
+ };
+
+}
+
+#endif