-
Notifications
You must be signed in to change notification settings - Fork 1
/
SignErrors.hpp
39 lines (33 loc) · 1023 Bytes
/
SignErrors.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
namespace ErrorsModule
{
enum SignInStatus
{
SUCCESS_SIGN_IN,
FAILURE_NETWORK_ERROR,
FAILURE_INVALID_UUID,
FAILURE_INVALID_ME_INFO,
FAILURE_GENERAL,
FAILURE_INVALID_AES,
ALREADY_REGISTERED,
FAILURE_IN_AES_ENCRYPTION,
FAILURE_INFO_CREATION,
FAILURE_RSA_KEY_CREATION
};
class SignInError : public std::runtime_error
{
public:
SignInError(const std::string& extraInfo, SignInStatus status);
explicit SignInError(SignInStatus status);
static const std::string getMessageForStatus(SignInStatus status);
SignInStatus getStatus() const;
const std::string& getExtraInfo() const { return extraInfo_; }
static const std::string getFullMessage(SignInStatus status,
const std::string& extraInfo);
static const std::map<SignInStatus, std::string> statusMessages;
private:
SignInStatus status_;
std::string extraInfo_;
static const std::string predefinedMessage;
};
} // namespace ErrorsModule