49 lines
779 B
Plaintext
49 lines
779 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,csharp]
|
|
----
|
|
try
|
|
{
|
|
/* some work which end up throwing an exception */
|
|
throw new ArgumentException();
|
|
}
|
|
finally
|
|
{
|
|
/* clean up */
|
|
throw new InvalidOperationException(); // Noncompliant; will mask the ArgumentException
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,csharp]
|
|
----
|
|
try
|
|
{
|
|
/* some work which end up throwing an exception */
|
|
throw new ArgumentException();
|
|
}
|
|
finally
|
|
{
|
|
/* clean up */ // Compliant
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|