Skip to content

Commit 9e28461

Browse files
author
Dave Abrahams
authored
Clarify error documentation guidelines.
1 parent 7f43315 commit 9e28461

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,15 @@ document exceptions by setting a project-wide policy that, unless a
108108
function is `noexcept`, it can throw anything. You can eliminate the
109109
need to document returned errors by encoding the ability to return an
110110
error in the function's signature. Documenting _which_ exceptions can be
111-
thrown or errors reported is not crucial, but documenting the fact
112-
_that_ an error can occur is.
111+
thrown or errors reported is not crucial[^exceptionspec], but
112+
documenting the fact _that_ an error can occur is.
113+
114+
[^exceptionspec]: In fact, documenting the specifics of errors
115+
reported is usually counterproductive, because the list can
116+
change due to shifts in what should be implementation details
117+
because it's seldom useful to the immediate caller, and because
118+
maintaining these lists through long call change is burdensome
119+
to the point of being impractical.
113120

114121
Unless otherwise specified in the function's documentation, a reported
115122
error means all objects the function would otherwise modify are

0 commit comments

Comments
 (0)