-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathExceptions.h
More file actions
46 lines (35 loc) · 955 Bytes
/
Exceptions.h
File metadata and controls
46 lines (35 loc) · 955 Bytes
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
40
41
42
43
44
45
46
#pragma once
#include <exception>
#include <string>
class UsernameAlreadyExistsException : public std::exception {
public:
const char *what() const throw() {
return message.c_str();
}
private:
const std::string message = "Error: username already exists";
};
class EmailAlreadyExistsException : public std::exception {
public:
const char *what() const throw() {
return message.c_str();
}
private:
const std::string message = "Error: email already exists";
};
class WrongUsernameOrPasswordException : public std::exception {
private:
const std::string message = "Error: wrong username or password!";
public:
const char *what() const throw() {
return message.c_str();
}
};
class DeleteAdminException : public std::exception {
public:
const char *what() throw() {
return message.c_str();
}
private:
const std::string message = "Error: can't delete admin account!";
};