rspec/rules/S3984/vbnet/rule.adoc
2021-06-02 20:44:38 +02:00

25 lines
476 B
Plaintext

Creating a new ``++Exception++`` without actually throwing it is useless and is probably due to a mistake.
== Noncompliant Code Example
----
If x < 0 Then
Dim ex = New ArgumentException("x must be nonnegative")
End If
----
== Compliant Solution
----
If x < 0 Then
Throw New ArgumentException("x must be nonnegative")
End If
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::rspecator-view[]