You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exceptions are not part of the C# type system. However, knowing what exceptions a method may throw is very useful.
Request
Add doc comments specifying what exceptions public methods may throw. Once documented, consider changing the exception to an incompatible type a breaking change. I have had to do into the source code in order to figure out what exceptions some methods throw.
Having useful doc comments on some public methods would be useful in general.
Note
If there is interest, I would gladly start making some PRs adding doc comments.
I have done a bit of a dive now. When code involves interfaces, deciding what the code might or might not throw becomes difficult. In the current codebase, different implementations of the interface can throw different exceptions. I think I will just sort of hand-wave things around interfaces.
Standardizing what exceptions an implementation might throw would require some code refactoring and possibly introducing wrapper exceptions.
Sorry for the very slow progress. I have made #398 to show what my idea would be. Any comments welcome. Is something like this what the project would be interested in?
Activity
akeit0 commentedon Oct 14, 2026
Seems nice.
boldikoller commentedon Oct 14, 2026
For the record, I would consider writing descriptions of the methods out-of-scope for this issue. I would only add stuff like:
/// <exception cref="InvalidOperationException">If the conversion is not possible.</exception>boldikoller commentedon Oct 19, 2026
I have done a bit of a dive now. When code involves interfaces, deciding what the code might or might not throw becomes difficult. In the current codebase, different implementations of the interface can throw different exceptions. I think I will just sort of hand-wave things around interfaces.
Standardizing what exceptions an implementation might throw would require some code refactoring and possibly introducing wrapper exceptions.
boldikoller commentedon Nov 2, 2026
Sorry for the very slow progress. I have made #398 to show what my idea would be. Any comments welcome. Is something like this what the project would be interested in?
boldikoller commentedon Nov 2, 2026
It is obviously not meant to be a ready PR, it is just to show what I was going for.