2020-06-30 12:48:07 +02:00
|
|
|
== Compliant Solution
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,text]
|
2020-06-30 12:48:07 +02:00
|
|
|
----
|
|
|
|
void DoSomething(int someParameter)
|
|
|
|
{
|
|
|
|
if (someParameter < 0)
|
|
|
|
{
|
|
|
|
throw new ArgumentException("Bad argument", nameof(someParameter));
|
|
|
|
}
|
|
|
|
if (anotherParam == null)
|
|
|
|
{
|
|
|
|
throw new Exception($"{nameof(anotherParam)} should not be null");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
----
|