rspec/rules/S1163/vbnet/rule.adoc

26 lines
549 B
Plaintext
Raw Normal View History

2023-06-12 09:22:59 +02:00
include::../why.adoc[]
2023-06-12 09:22:59 +02:00
[source,vbnet,diff-id=1,diff-type=noncompliant]
2021-01-22 04:06:24 +00:00
----
Try
' Some work which end up throwing an exception
Throw New ArgumentException()
Finally
2023-06-12 09:22:59 +02:00
' Cleanup
Throw New InvalidOperationException() ' Noncompliant: will mask the ArgumentException
2021-01-22 04:06:24 +00:00
End Try
----
2023-06-12 09:22:59 +02:00
[source,vbnet,diff-id=1,diff-type=compliant]
2021-01-22 04:06:24 +00:00
----
Try
' Some work which end up throwing an exception
Throw New ArgumentException()
Finally
2023-06-12 09:22:59 +02:00
' Cleanup without throwing
2021-01-22 04:06:24 +00:00
End Try
----
2023-06-12 09:22:59 +02:00
include::../resources-dotnet.adoc[]
2023-06-12 09:22:59 +02:00
include::../rspecator.adoc[]