- 0133技术站
- 联系QQ:18840023
- QQ交流群

- 微信公众号

描述: 说明可能会被抛出什么样的错误。
别名:
@throws free-form description
@throws {<type>}
@throws {<type>} free-form description
@throws标签可以让你描述函数可能会抛出的错误。在一个JSDoc注释块中您可以包含多个@throws标签。
例如,在type中使用@throws标签:
/** * @throws {InvalidArgumentException} */ function foo(x) {}
例如,在描述中使用@throws标签:
/** * @throws Will throw an error if the argument is null. */ function bar(x) {}
例如,在type和描述中使用@throws标签:
/** * @throws {DivideByZero} Argument x must be non-zero. */ function baz(x) {}
推荐手册