|
template<typename FirstArg , typename... Args> |
| error (error_code code, const FirstArg &arg, const Args &... args) |
| Constructs an error with a code and a concatenated message from multiple arguments.
|
|
| error (error_code code, const std::string &message) |
| Constructs an error with a code and a message string.
|
|
| error (error_code code, const char *message) |
| Constructs an error with a code and a message C-string.
|
|
error_code | code () const noexcept |
| Returns the error code associated with this error.
|
|
The primary exception class used by the IP address library.
This class extends the standard std::runtime_error
and serves as the base exception type for the library. It is designed to be thrown when an error condition is encountered during the processing of IP addresses, such as parsing errors or logical inconsistencies.
The error
class encapsulates an error_code
value representing the specific error that occurred, along with a descriptive message that provides context about the error. This design allows for precise and informative error reporting, aiding in debugging and error handling.
Overall, the error
class is a critical component of the library's error management system, providing a standardized way to handle exceptions throughout the library.
- See also
- parse_error
-
logic_error