NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
dns_exception类 参考final

DNS异常类 更多...

#include <dns_message.hpp>

类 dns_exception 继承关系图:
[图例]

Public 类型

enum class  code {
  TIMEOUT , NETWORK_ERROR , PARSE_ERROR , SERVER_FAILURE ,
  TRUNCATED , NO_RECORD
}
 DNS异常错误码 更多...

静态 Public 成员函数

static dns_exception timeout ()
 创建超时异常
static dns_exception network_error (const string &detail, const code code=code::NETWORK_ERROR)
 创建网络错误异常
static dns_exception parse_error (const string &detail)
 创建解析错误异常

额外继承的成员函数

Public 成员函数 继承自 exception
 exception (const char *info=static_type, const char *type=static_type, const int code=0)
 构造函数
 exception (const exception &other) noexcept
 复制构造函数
exceptionoperator= (const exception &other) noexcept
 复制赋值运算符
 exception (exception &&other) noexcept
 移动构造函数
exceptionoperator= (exception &&other) noexcept
 移动赋值运算符
template<typename Error>
 exception (const Error &error)
 模板构造函数
virtual ~exception ()=default
 虚析构函数
NEFORCE_NODISCARD const char * what () const noexcept
 获取错误信息
NEFORCE_NODISCARD const char * type () const noexcept
 获取异常类型
NEFORCE_NODISCARD int code () const noexcept
 获取异常码
静态 Public 属性 继承自 exception
static constexpr auto static_type = "exception"
 静态类型字符串

详细描述

DNS异常类

DNS操作失败时抛出的异常,包含错误类型和详细信息。

在文件 dns_message.hpp232 行定义.

成员枚举类型说明

◆ code

enum class dns_exception::code
strong

DNS异常错误码

枚举值
TIMEOUT 

查询超时

NETWORK_ERROR 

网络错误

PARSE_ERROR 

解析错误

SERVER_FAILURE 

服务器失败

TRUNCATED 

响应被截断

NO_RECORD 

无记录

在文件 dns_message.hpp238 行定义.

成员函数说明

◆ network_error()

dns_exception dns_exception::network_error ( const string & detail,
const code code = code::NETWORK_ERROR )
inlinestatic

创建网络错误异常

参数
detail错误详情
code错误码
返回
DNS异常对象

在文件 dns_message.hpp265 行定义.

引用了 NETWORK_ERROR.

◆ parse_error()

dns_exception dns_exception::parse_error ( const string & detail)
inlinestatic

创建解析错误异常

参数
detail错误详情
返回
DNS异常对象

在文件 dns_message.hpp274 行定义.

引用了 PARSE_ERROR.

◆ timeout()

dns_exception dns_exception::timeout ( )
inlinestatic

创建超时异常

返回
DNS异常对象

在文件 dns_message.hpp257 行定义.

引用了 TIMEOUT.


该类的文档由以下文件生成: