Giter VIP home page Giter VIP logo

Comments (4)

pedromagueija avatar pedromagueija commented on July 22, 2024

Hi Jasper,

The exception being documented is the main point, not the arguments being checked. Regardless of which parameter is null, the exception thrown is the same, thus the check passes (the exception is documented).

In this particular case, the message could be manually edited to reflect both parameters that are checked.
Do you agree?

from exceptionalresharper.

jesperbrasmussen avatar jesperbrasmussen commented on July 22, 2024

Hi Pedro

I agree that the exception could be manually edited. But that partly defeat the purpose of autogenerating documentation. I still think that the documentation must in this case contain which parameters that can throw an ArgumentNullException, because this also shows which doesn't.

from exceptionalresharper.

pedromagueija avatar pedromagueija commented on July 22, 2024

I understand your point.

So something like this would be ok for you?

/// <exception cref="ArgumentNullException">
///   <paramref name="fileData"/> is <see langword="null" /> or
///   <paramref name="fileName"/> is <see langword="null" />.
/// </exception>
public Guid Import(Stream fileData, string fileName, Guid? cachedFileId)
{
    if (fileData == null) throw new ArgumentNullException("fileData");
    if (fileName == null) throw new ArgumentNullException("fileName");
}


from exceptionalresharper.

jesperbrasmussen avatar jesperbrasmussen commented on July 22, 2024

Yes that is how i would write it except that Microsoft writes it like this "-or-" in their documentation.

from exceptionalresharper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.