summaryrefslogtreecommitdiffstats
path: root/crypt/cryptexception.h
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-09-15 14:32:43 +0200
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-09-15 14:35:36 +0200
commit9dd195ddd3bce8183a43f9653e7caec5dd0a23ee (patch)
tree2667d483f1c8984fddf444df04dd9465e9232533 /crypt/cryptexception.h
parent0764b73f6a61160ad6765f17073110d8236b68d1 (diff)
downloadsrc-9dd195ddd3bce8183a43f9653e7caec5dd0a23ee.tar.gz
src-9dd195ddd3bce8183a43f9653e7caec5dd0a23ee.zip
Nutze ein Enum zur leichteren ReturnCodeverwaltung
Diffstat (limited to 'crypt/cryptexception.h')
-rw-r--r--crypt/cryptexception.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/crypt/cryptexception.h b/crypt/cryptexception.h
index 1141969..7f70211 100644
--- a/crypt/cryptexception.h
+++ b/crypt/cryptexception.h
@@ -2,18 +2,32 @@
#define CRYPTEXCEPTION_H
#include <exception>
+
#include <QString>
class CryptException : public std::exception
{
public:
/**
+ * @brief The ReturnCode enum
+ */
+ enum ReturnCode
+ {
+ FileNotFound = 1,
+ FileNotWritable,
+ DecryptionErrorRsa,
+ DecryptionErrorAes,
+ OpenSslError,
+ KeyNotRsa
+ };
+
+ /**
* @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);
+ CryptException(std::string what, ReturnCode returnCode);
/**
* @brief ~CryptException
@@ -32,11 +46,11 @@ public:
* Gibt den Konsolenrückgabewert zurück.
* @return Der Rückgabewert für die Konsole.
*/
- int returnCode() const;
+ ReturnCode returnCode() const;
private:
std::string whatMsg;
- int retId;
+ ReturnCode retId;
};