Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation warnings do not support Exception hierarchy #46

Closed
rwv37 opened this issue Oct 25, 2016 · 2 comments
Closed

Documentation warnings do not support Exception hierarchy #46

rwv37 opened this issue Oct 25, 2016 · 2 comments

Comments

@rwv37
Copy link

rwv37 commented Oct 25, 2016

If you throw some sort of exception, and document the method as throwing a base type of that exception's type, you'll get two inappropriate errors from Exceptional. For example, in the following,

(1) Task.Delay() can throw a TaskCanceledException;
(2) A TaskCanceledException is an OperationCanceledException;
(3) The method is documented as throwing OperationCanceledException

... and yet Exceptional gives the following seemingly inappropriate messages:

(1) Exception 'OperationCanceledException' is not thrown
(2) Exception 'TaskCanceledException' is not documented

    /// <summary>
    /// The blah async.
    /// </summary>
    /// <param name="cancellationToken">
    /// The cancellation token.
    /// </param>
    /// <returns>
    /// The <see cref="Task"/>.
    /// </returns>
    /// <exception cref="OperationCanceledException">
    /// The operation was canceled.
    /// </exception>
    public async Task BlahAsync(CancellationToken cancellationToken)
    {
        await Task.Delay(37, cancellationToken).ConfigureAwait(false);
    }
@pedromagueija
Copy link
Contributor

There is an option in settings that allow for base types to suffice as documented exceptions:

Resharper -> Options -> Exception -> General tab -> Documentation of thrown exception's subtype is sufficient

Mark both checkboxes and then make a change in the file and save.

@rwv37
Copy link
Author

rwv37 commented Oct 27, 2016

Great. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants