-
Notifications
You must be signed in to change notification settings - Fork 1
/
ErrorsModule.hpp
43 lines (33 loc) · 996 Bytes
/
ErrorsModule.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
40
41
42
43
#pragma once
#include <map>
#include <stdexcept>
#include <string>
namespace ErrorsModule
{
// ==================== Files ====================
class NoMoreFilesException : public std::runtime_error
{
public:
NoMoreFilesException() : std::runtime_error(predefinedMessage) {}
// Overloaded constructor for custom messages
explicit NoMoreFilesException(const std::string& customMessage)
: std::runtime_error(customMessage)
{
}
private:
static const std::string predefinedMessage;
};
// ==================== Return Client ====================
class AlreadyRegisteredException : public std::runtime_error
{
public:
AlreadyRegisteredException() : std::runtime_error(predefinedMessage) {}
// Overloaded constructor for custom messages
explicit AlreadyRegisteredException(const std::string& customMessage)
: std::runtime_error(customMessage)
{
}
private:
static const std::string predefinedMessage;
};
} // namespace ErrorsModule