rspec/rules/S3984/vbnet/rule.adoc

26 lines
502 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
Creating a new ``++Exception++`` without actually throwing it is useless and is probably due to a mistake.
2020-06-30 12:48:39 +02:00
== 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::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]