2023-06-12 09:22:59 +02:00

32 lines
549 B
Plaintext

include::../why.adoc[]
[source,csharp,diff-id=1,diff-type=noncompliant]
----
try
{
// Some work which end up throwing an exception
throw new ArgumentException();
}
finally
{
// Cleanup
throw new InvalidOperationException(); // Noncompliant: will mask the ArgumentException
}
----
[source,csharp,diff-id=1,diff-type=compliant]
----
try
{
// Some work which end up throwing an exception
throw new ArgumentException();
}
finally
{
// Cleanup without throwing
}
----
include::../resources-dotnet.adoc[]
include::../rspecator.adoc[]