hutool.core.exceptions¶
异常类定义,对应 Java cn.hutool.core.exceptions。
Module Contents¶
API¶
- exception hutool.core.exceptions.UtilException(message: str, *args)¶
Bases:
Exception工具类通用异常。
对应 Java cn.hutool.core.exceptions.UtilException。 支持 format 风格的消息格式化。
Initialization
构造工具类通用异常。
- 参数:
message – 异常消息(支持 format 格式化)
args – 格式化参数
- exception hutool.core.exceptions.IORuntimeException(message: str, *args)¶
Bases:
hutool.core.exceptions.UtilExceptionIO 运行时异常。
对应 Java cn.hutool.core.exceptions.IORuntimeException。
Initialization
构造 IO 运行时异常。
- 参数:
message – 异常消息
args – 格式化参数
- exception hutool.core.exceptions.StatefulException(message: str, *args)¶
Bases:
hutool.core.exceptions.UtilException有状态的异常,可携带额外状态信息。
Initialization
构造有状态的异常。
- 参数:
message – 异常消息
args – 格式化参数
- exception hutool.core.exceptions.NotInitedException(message: str = 'Not initialized', *args)¶
Bases:
hutool.core.exceptions.UtilException未初始化异常。
Initialization
构造未初始化异常。
- 参数:
message – 异常消息,默认 “Not initialized”
args – 格式化参数
- exception hutool.core.exceptions.NullPointerException(message: str = 'Null pointer', *args)¶
Bases:
hutool.core.exceptions.UtilException空指针异常。
Initialization
构造空指针异常。
- 参数:
message – 异常消息,默认 “Null pointer”
args – 格式化参数
- exception hutool.core.exceptions.IllegalArgumentException(message: str, *args)¶
Bases:
hutool.core.exceptions.UtilException非法参数异常。
Initialization
构造非法参数异常。
- 参数:
message – 异常消息
args – 格式化参数
- exception hutool.core.exceptions.IllegalStateException(message: str, *args)¶
Bases:
hutool.core.exceptions.UtilException非法状态异常。
Initialization
构造非法状态异常。
- 参数:
message – 异常消息
args – 格式化参数
- exception hutool.core.exceptions.ValidateException(message: str, *args)¶
Bases:
hutool.core.exceptions.IllegalArgumentException校验异常。
对应 Java cn.hutool.core.lang.Validator.ValidateException。 在校验方法(validate_*)失败时抛出。
Initialization
构造校验异常。
- 参数:
message – 异常消息
args – 格式化参数
- exception hutool.core.exceptions.UnsupportedOperationException(message: str = 'Unsupported operation', *args)¶
Bases:
hutool.core.exceptions.UtilException不支持的操作异常。
Initialization
构造不支持的操作异常。
- 参数:
message – 异常消息,默认 “Unsupported operation”
args – 格式化参数