Skip to content

Add doc comments to public methods #363

Open

Description

@boldikoller

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.

Activity

  1. akeit0 commented on Oct 14, 2026

    @akeit0
    Collaborator

    Seems nice.

  2. boldikoller commented on Oct 14, 2026

    @boldikoller
    Author

    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>
  3. boldikoller commented on Oct 19, 2026

    @boldikoller
    Author

    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.

  4. boldikoller commented on Nov 2, 2026

    @boldikoller
    Author

    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?

  5. boldikoller commented on Nov 2, 2026

    @boldikoller
    Author

    It is obviously not meant to be a ready PR, it is just to show what I was going for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions