Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 322 Bytes

MA0015.md

File metadata and controls

15 lines (13 loc) · 322 Bytes

MA0015 - Specify the parameter name in ArgumentException

void Sample(string str)
{
    if (str == "")
        throw new ArgumentException("Error message"); // non-compliant
}

void Sample(string str)
{
    if (str == "")
        throw new ArgumentException("Error message", paramName: nameof(str)); // ok
}