异常类
class IllegalSetException
public class IllegalSetException <: ReflectException {
public init()
public init(message: String)
}
功能:IllegalSetException 为对不可变类型进行更改异常。
注意:
不支持平台:macOS、iOS。
父类型:
init()
public init()
功能:创建 IllegalSetException 实例。
注意:
不支持平台:macOS、iOS。
示例:
import std.reflect.IllegalSetException
main(): Int64 {
// 创建 IllegalSetException 实例
let exception = IllegalSetException()
return 0
}
init(String)
public init(message: String)
功能:根据异常信息创建 IllegalSetException 实例。
注意:
不支持平台:macOS、iOS。
参数:
- message: String - 异常信息。
示例:
import std.reflect.IllegalSetException
main(): Int64 {
// 根据异常信息创建 IllegalSetException 实例
let exception = IllegalSetException("更改异常")
return 0
}
class IllegalTypeException
public class IllegalTypeException <: ReflectException {
public init()
public init(message: String)
}
功能:IllegalTypeException 为类型不匹配异常。
注意:
不支持平台:macOS、iOS。
父类型:
init()
public init()
功能:创建 IllegalTypeException 实例。
注意:
不支持平台:macOS、iOS。
示例:
import std.reflect.IllegalTypeException
main(): Int64 {
// 创建 IllegalTypeException 实例
let exception = IllegalTypeException()
return 0
}
init(String)
public init(message: String)
功能:根据异常信息创建 IllegalTypeException 实例。
注意:
不支持平台:macOS、iOS。
参数:
- message: String - 异常信息。
示例:
import std.reflect.IllegalTypeException
main(): Int64 {
// 根据异常信息创建 IllegalTypeException 实例
let exception = IllegalTypeException("类型不匹配")
return 0
}
class InfoNotFoundException
public class InfoNotFoundException <: ReflectException {
public init()
public init(message: String)
}
功能:InfoNotFoundException 为无法找到对应信息异常。
注意:
不支持平台:macOS、iOS。
父类型:
init()
public init()
功能:创建 InfoNotFoundException 实例。
注意:
不支持平台:macOS、iOS。
示例:
import std.reflect.InfoNotFoundException
main(): Int64 {
// 创建 InfoNotFoundException 实例
let exception = InfoNotFoundException()
return 0
}
init(String)
public init(message: String)
功能:根据异常信息创建 InfoNotFoundException 实例。
注意:
不支持平台:macOS、iOS。
参数:
- message: String - 异常信息。
示例:
import std.reflect.InfoNotFoundException
main(): Int64 {
// 根据异常信息创建 InfoNotFoundException 实例
let exception = InfoNotFoundException("未找到相关信息")
return 0
}
class InvocationTargetException
public class InvocationTargetException <: ReflectException {
public init()
public init(message: String)
}
功能:InvocationTargetException 为调用函数包装异常。
注意:
不支持平台:macOS、iOS。
父类型:
init()
public init()
功能:创建 InvocationTargetException 实例。
注意:
不支持平台:macOS、iOS。
示例:
import std.reflect.InvocationTargetException
main(): Int64 {
// 创建 InvocationTargetException 实例
let exception = InvocationTargetException()
return 0
}
init(String)
public init(message: String)
功能:根据异常信息创建 InvocationTargetException 实例。
注意:
不支持平台:macOS、iOS。
参数:
- message: String - 异常信息。
示例:
import std.reflect.InvocationTargetException
main(): Int64 {
// 根据异常信息创建 InvocationTargetException 实例
let exception = InvocationTargetException("调用目标异常")
return 0
}
class MisMatchException
public class MisMatchException <: ReflectException {
public init()
public init(message: String)
}
功能:MisMatchException 为调用对应函数抛出异常。
注意:
不支持平台:macOS、iOS。
父类型:
init()
public init()
功能:创建 MisMatchException 实例。
注意:
不支持平台:macOS、iOS。
示例:
import std.reflect.MisMatchException
main(): Int64 {
// 创建 MisMatchException 实例
let exception = MisMatchException()
return 0
}
init(String)
public init(message: String)
功能:根据异常信息创建 MisMatchException 实例。
注意:
不支持平台:macOS、iOS。
参数:
- message: String - 异常信息。
示例:
import std.reflect.MisMatchException
main(): Int64 {
// 根据异常信息创建 MisMatchException 实例
let exception = MisMatchException("函数调用不匹配")
return 0
}
class ReflectException
public open class ReflectException <: Exception {
public init()
public init(message: String)
}
功能:ReflectException 为 Reflect 包的基异常类。
注意:
不支持平台:macOS、iOS。
父类型:
init()
public init()
功能:创建 ReflectException 实例。
注意:
不支持平台:macOS、iOS。
示例:
import std.reflect.ReflectException
main(): Int64 {
// 创建 ReflectException 实例
let exception = ReflectException()
return 0
}
init(String)
public init(message: String)
功能:根据异常信息创建 ReflectException 实例。
注意:
不支持平台:macOS、iOS。
参数:
- message: String - 异常信息。
示例:
import std.reflect.ReflectException
main(): Int64 {
// 根据异常信息创建 ReflectException 实例
let exception = ReflectException("反射操作异常")
return 0
}