ipaddress 1.1.0
Loading...
Searching...
No Matches
logic_error Class Reference

Exception for logical errors in IP address operations. More...

#include <errors.hpp>

Inheritance diagram for logic_error:

Public Member Functions

template<typename FirstArg , typename... Args>
 logic_error (error_code code, const FirstArg &arg, const Args &... args)
 Constructs a logic error with a code and a concatenated message from multiple arguments.
 
 logic_error (error_code code, const std::string &message)
 Constructs a logic error with a code and a message string.
 
 logic_error (error_code code, const char *message)
 Constructs a logic error with a code and a message C-string.
 
error_code code () const noexcept
 Returns the error code associated with this error.
 

Detailed Description

Exception for logical errors in IP address operations.

This exception is thrown for logical errors that do not pertain directly to parsing, such as using an incorrect prefix length or other operations that violate the logic of IP address manipulation. It extends the error class to provide additional context for these types of logical issues.

See also
error

Constructor & Destructor Documentation

◆ logic_error() [1/3]

template<typename FirstArg , typename... Args>
logic_error ( error_code code,
const FirstArg & arg,
const Args &... args )
inlineexplicit

Constructs a logic error with a code and a concatenated message from multiple arguments.

Template Parameters
FirstArgThe type of the first argument passed to the constructor.
ArgsThe types of the additional arguments passed to the constructor.
Parameters
[in]codeThe error code associated with the logical exception.
[in]argThe first argument describing the error.
[in]argsAdditional arguments describing the error.

◆ logic_error() [2/3]

logic_error ( error_code code,
const std::string & message )
inlineexplicit

Constructs a logic error with a code and a message string.

Parameters
[in]codeThe error code associated with the logical exception.
[in]messageA detailed description of the logical error.

◆ logic_error() [3/3]

logic_error ( error_code code,
const char * message )
inlineexplicit

Constructs a logic error with a code and a message C-string.

Parameters
[in]codeThe error code associated with the logical exception.
[in]messageA detailed description of the logical error.

Member Function Documentation

◆ code()

error_code code ( ) const
inlinenoexceptinherited

Returns the error code associated with this error.

Returns
The error code that represents the specific error condition.

The documentation for this class was generated from the following file: