summaryrefslogtreecommitdiffstats
path: root/crypt/cryptexception.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypt/cryptexception.h')
-rw-r--r--crypt/cryptexception.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/crypt/cryptexception.h b/crypt/cryptexception.h
new file mode 100644
index 0000000..1141969
--- /dev/null
+++ b/crypt/cryptexception.h
@@ -0,0 +1,43 @@
+#ifndef CRYPTEXCEPTION_H
+#define CRYPTEXCEPTION_H
+
+#include <exception>
+#include <QString>
+
+class CryptException : public std::exception
+{
+public:
+ /**
+ * @brief CryptException
+ * Erzeugt eine Exception mit den angegebenen Werten.
+ * @param what Die Fehlermeldung, die dem Nutzer gezeigt wird.
+ * @param returnCode Der Rückgabewert für die Konsole.
+ */
+ CryptException(std::string what, int returnCode);
+
+ /**
+ * @brief ~CryptException
+ */
+ virtual ~CryptException() throw();
+
+ /**
+ * @brief what
+ * Gibt die Fehlermelung für den Nutzer zurück.
+ * @return Die Fehlermeldung für den Nutzer.
+ */
+ virtual const char *what() const throw();
+
+ /**
+ * @brief returnCode
+ * Gibt den Konsolenrückgabewert zurück.
+ * @return Der Rückgabewert für die Konsole.
+ */
+ int returnCode() const;
+
+private:
+ std::string whatMsg;
+ int retId;
+
+};
+
+#endif // CRYPTEXCEPTION_H