返回所有已注册的异常类型列表.
ExceptionTypes[tagspec]
返回所有已注册的异常类型列表,这些类型是 tagspec 中指定类型的子类型.
ExceptionTypes
返回所有已注册的异常类型列表.
ExceptionTypes[tagspec]
返回所有已注册的异常类型列表,这些类型是 tagspec 中指定类型的子类型.
更多信息
- ExceptionTypes[All] 等价于 ExceptionTypes[].
- 规范 tagspec 可以是以下几种之一:
-
tag 单个有效的异常类型(符号或字符串) {tag1,tag2,…} 有效异常类型的列表 - 在 tagspec 中的父异常类型本身不必注册.
- tagspec 中注册的异常类型将包含在结果中.
范例
基本范例 (2)
ExceptionTypes[]这将注册单个异常类型 "GeneralError" 的三个子类型:
RegisterExceptionType[ArgumentError, "GeneralError"]
RegisterExceptionType[IOError, "GeneralError"]
RegisterExceptionType[ArgumentTypeError, ArgumentError]ExceptionTypes[]获取已注册的、属于 ArgumentError 子类型的类型(包括它自身):
ExceptionTypes[ArgumentError]Unprotect[ArgumentError, IOError, ArgumentTypeError]
DeleteObject /@ {ArgumentTypeError, ArgumentError, IOError}技术笔记
-
▪
- 处理异常
文本
Wolfram Research (2026),ExceptionTypes,Wolfram 语言函数,https://reference.wolfram.com/language/ref/ExceptionTypes.html.
CMS
Wolfram 语言. 2026. "ExceptionTypes." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/ExceptionTypes.html.
APA
Wolfram 语言. (2026). ExceptionTypes. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/ExceptionTypes.html 年
BibTeX
@misc{reference.wolfram_2026_exceptiontypes, author="Wolfram Research", title="{ExceptionTypes}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/ExceptionTypes.html}", note=[Accessed: 07-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_exceptiontypes, organization={Wolfram Research}, title={ExceptionTypes}, year={2026}, url={https://reference.wolfram.com/language/ref/ExceptionTypes.html}, note=[Accessed: 07-September-2026]}