20 _msg =
"Error: The ip you provided '";
22 _msg +=
"' is incorrect, it should be of type ipV4.\n";
23 _msg +=
"Hint: An IpV4 is:\n";
24 _msg +=
"-\tComposed of 4 whole numbers\n";
25 _msg +=
"-\tEach whole number ranges from 0 to 255\n";
26 _msg +=
"-\tEach whole number is connected to the next one by a '.'\n";
27 _msg +=
"-\tHere is a typical example of an IpV4 address: '127.0.0.1";
28 _buffer = _msg.c_str();
40 _msg =
"Error: The port you provided '";
42 _msg +=
"' is incorrect.\n";
43 _msg +=
"Hint: The port should be a whole number in the range between 0 and 65535";
44 _buffer = _msg.c_str();
56 _msg =
"Error: The content present in std::any does not match ";
57 _msg +=
"the provided type (or is just missing).";
58 if (!extraDetails.empty()) {
59 _msg +=
"\n(" + extraDetails +
")";
61 _buffer = _msg.c_str();
73 _msg =
"Error: The username you provided '";
75 _msg +=
"' is incorrect.\n";
76 _msg +=
"Hint1/3: The Username should not be empty or contain special characters like emojis.\n";
77 _msg +=
"Hint2/3: The Username should not exceed '" +
Recoded::myToString(USERNAME_MAX_LENGTH) +
"' characters and only be made of printable ascii characters as well as the ' ' character.\n";
78 _msg +=
"Hint3/3: The Username should not be below '" +
Recoded::myToString(USERNAME_MIN_LENGTH) +
"' characters or be composed of only whitespaces.";
79 _buffer = _msg.c_str();
91 _msg =
"Error: The operation you tried to perform did not succeed.\n";
93 _msg +=
"The operation provided the following message: '" + error +
"'.\n";
95 _buffer = _msg.c_str();
107 _msg =
"Error: The option you chose is invalid.\n";
108 if (!error.empty()) {
109 _msg +=
"The function in charge of processing your choice provided the following message: '" + error +
"'.\n";
111 _buffer = _msg.c_str();
123 _msg =
"Error: The duration you provided is invalid.\n";
124 if (!min.empty() && !max.empty()) {
125 _msg +=
"The duration must be in the range '" + min +
"' to '" + max +
"'.\n";
126 }
else if (!min.empty() && max.empty()) {
127 _msg +=
"The duration must be greater than or equal to '" + min +
"'.\n";
128 }
else if (min.empty() && !max.empty()) {
129 _msg +=
"The duration must be less than or equal to '" + max +
"'.\n";
131 _msg +=
"The duration must be a valid number.\n";
133 _msg +=
"The duration was: '";
136 _buffer = _msg.c_str();
148 _msg =
"Error: The number you provided is invalid.\n";
149 if (!min.empty() && !max.empty()) {
150 _msg +=
"The number must be in the range '" + min +
"' to '" + max +
"'.\n";
151 }
else if (!min.empty() && max.empty()) {
152 _msg +=
"The number must be greater than or equal to '" + min +
"'.\n";
153 }
else if (min.empty() && !max.empty()) {
154 _msg +=
"The number must be less than or equal to '" + max +
"'.\n";
156 _msg +=
"The number must be a valid number.\n";
158 _msg +=
"The number was: '";
161 _buffer = _msg.c_str();
173 _msg =
"Error: The TOML file you provided is invalid\n";
174 _msg +=
"The filepath you provided is '" + path +
"'.\n";
175 _msg +=
"The detailed error is '" + error +
"'.";
176 _buffer = _msg.c_str();
188 _msg =
"Error: The type of the key '";
193 _msg += expectedType;
194 _msg +=
"' type was expected for the configuration file '";
197 _buffer = _msg.c_str();
This file contains the definitions of custom exception classes used to inform the user about various ...
~InvalidChoice()
Destroy the InvalidChoice object.
const char * what() const noexcept
Retrieves the error message.
InvalidChoice(const std::string &error="")
Construct a new InvalidChoice object.
const char * what() const noexcept
Retrieves the error message.
~InvalidDuration()
Destroy the InvalidDuration object.
InvalidDuration(const std::string &duration="", const std::string &min="", const std::string &max="")
Construct a new InvalidDuration object.
~InvalidIp()
Destroy the InvalidIp object.
const char * what() const noexcept
Retrieves the error message.
InvalidIp(const std::string &error="")
Construct a new InvalidIp object.
~InvalidNumber()
Destroy the InvalidNumber object.
InvalidNumber(const std::string &number="", const std::string &min="", const std::string &max="")
Construct a new InvalidNumber object.
const char * what() const noexcept
Retrieves the error message.
const char * what() const noexcept
Retrieves the error message.
~InvalidOperation()
Destroy the InvalidOperation object.
InvalidOperation(const std::string &error="")
Construct a new InvalidOperation object.
~InvalidPort()
Destroy the InvalidPort object.
InvalidPort(const std::string &error="")
Construct a new InvalidPort object.
const char * what() const noexcept
Retrieves the error message.
InvalidTOMLKeyType(const std::string &tomlPath="", const std::string &tomlKey="", const std::string ¤tType="", const std::string &expectedType="")
Construct a new InvalidTOMLKeyType object.
~InvalidTOMLKeyType()
Destroy the InvalidTOMLKeyType object.
const char * what() const noexcept
Retrieves the error message.
InvalidTOML(const std::string &path="", const std::string &error="")
Construct a new InvalidTOML object.
const char * what() const noexcept
Retrieves the error message.
~InvalidTOML()
Destroy the InvalidTOML object.
InvalidType(const std::string &extraDetails="")
Construct a new InvalidType object.
const char * what() const noexcept
Retrieves the error message.
~InvalidType()
Destroy the InvalidType object.
InvalidUsername(const std::string &error="")
Construct a new InvalidUsername object.
const char * what() const noexcept
Retrieves the error message.
~InvalidUsername()
Destroy the InvalidUsername object.
const std::string myToString(bool value)
Converts a boolean value to its string representation.