更新:2007 年 11 月
创建一个表示 Sys.ArgumentOutOfRangeException 异常的 Error 对象。
var err = Error.argumentOutOfRange(paramName, actualValue, message);
参数
paramName
(可选)导致该异常的参数的名称。该值可以为 null。actualValue
(可选)导致该异常的参数值。该值可以为 null。message
(可选)错误消息字符串。该值可以为 null。如果 message 为 null,则使用默认消息。
返回值
一个 Error 对象,该对象将 name、paramName 和 actualValue 字段添加到 Error 类型定义。
备注
使用 argumentOutOfRange 函数可以在调用函数或方法且参数值在可接受范围之外时通知发生了异常。使用 argumentOutOfRange 函数可以创建一个表示 Sys.ArgumentOutOfRangeException 异常的 Error 对象,该异常中可包含用于处理异常的附加信息。