JSDoc @throws 标签
目录
同义词
JSDoc @exception 标签
语法
@throws free-form description
@throws {<type>}
@throws {<type>} free-form description
概述
@throws
标签可以让你描述函数可能会抛出的错误。在一个JSDoc注释块中您可以包含多个@throws
标签。
示例
/**
* @throws {InvalidArgumentException}
*/
function foo(x) {}
/**
* @throws Will throw an error if the argument is null.
*/
function bar(x) {}
/**
* @throws {DivideByZero} Argument x must be non-zero.
*/
function baz(x) {}