@throws
Содержание
Синонимы
@exception
Синтаксис
@throws free-form description@throws {<type>}@throws {<type>} free-form description
Обзор
Тег @throws позволяет документировать ошибку, которую может сгенерировать функция. В одном комментарии JSDoc вы можете использовать тег @throws более одного раза.
Примеры
Использование тега @throws с типом
/**
* @throws {InvalidArgumentException}
*/
function foo(x) {}
Использование тега @throws с описанием
/**
* @throws Will throw an error if the argument is null.
*/
function bar(x) {}
Использование тега @throws с типом и описанием
/**
* @throws {DivideByZero} Argument x must be non-zero.
*/
function baz(x) {}
© 2011–2017 the contributors to the JSDoc 3 documentation project
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://jsdoc.app/tags-throws.html