Add JSDoc throws description to assertion functions
refactor(dev-infra): add JSDoc throws description to assertion functions (#42454)
Add JSDoc throws description to assertion functionsrefactoradd jsdoc throws description assertion functions
Committed by devversion
commit message
refactor(dev-infra): add JSDoc throws description to assertion functions (#42454)
Adds the JSDoc `@throws` annotation to functions that would throw
within in the ng-dev tool. We want to add `@throws` so clearly
communicate if the invocation of a function results in errors or not.
This helps if IDEs show the `@throws` annotation on invocation, or
if TS ever lands a feature like Java `throws`, with more fine-grained
and typed error handling.
PR Close #42454Editor assessment
Add JSDoc throws description to assertion functions states the documentation addition, and the body argues the purpose well: the annotations communicate invocation failures in editors today and anticipate future typed error handling like a Java-style throws. That is forward-looking rationale for a doc-comment sweep. The dev-infra scope and refactor type are a defensible straddle, and hygiene is clean throughout. Publishable with only minor flaws. The editor-display and future-typed-errors arguments give a doc-comment sweep a purpose beyond tidiness, which is what lifts it.