-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptions.h
More file actions
23 lines (15 loc) · 781 Bytes
/
Exceptions.h
File metadata and controls
23 lines (15 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef EXCEPTIONS_H
#define EXCEPTIONS_H
// DO NOT CHANGE THIS FILE
#include "Utility.h"
struct UsernameTakenException : runtime_error
{
UsernameTakenException(const string& username) : runtime_error(username + string(" is already taken.")) {}
};
struct UserDoesNotExistException : runtime_error {
UserDoesNotExistException(const string& username) : std::runtime_error(username + string(" does not exist.")) {}
};
struct RedundantActionException : std::runtime_error {
RedundantActionException(const string& username1, const string& username2, const bool& follow) : runtime_error((follow ? (username1 + string(" already follows ") + username2 + string(".")) : (username1 + string(" already does not follow ") + username2) + string("."))) {}
};
#endif // !EXCEPTIONS_H