diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-09-04 20:56:41 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-09-04 20:56:41 +0200 |
| commit | a1aa74e5edb90266637c529dd96dd3487ac7d712 (patch) | |
| tree | 09b3d4400f342e1d0c299a60abac207cac7e7a63 /crypt/cryptexception.h | |
| parent | ee895e9a12b1bad4f1151aba4766102fcef1073e (diff) | |
| download | src-a1aa74e5edb90266637c529dd96dd3487ac7d712.tar.gz src-a1aa74e5edb90266637c529dd96dd3487ac7d712.zip | |
FÃge CryptException zur Fehlerbehandlung hinzu
Diffstat (limited to 'crypt/cryptexception.h')
| -rw-r--r-- | crypt/cryptexception.h | 43 |
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 |
