Returning from a ``++finally++`` block suppresses the propagation of any unhandled exception which was thrown in the ``++try++`` or ``++catch++`` block.

== Noncompliant Code Example

----
void openResource() {
  @throw [NSException exceptionWithName:@"FileNotFoundException" reason:@"File Not Found on System" userInfo:nil];
}

void fun() {
  @try {
    openResource();
  }
  @finally {
    closeResource();
    return; // Noncompliant - prevents the exception from being propagated
  }
}
----

== Compliant Solution

----
void openResource() {
  @throw [NSException exceptionWithName:@"FileNotFoundException" reason:@"File Not Found on System" userInfo:nil];
}

void fun() {
  @try {
    openResource();
  }
  @finally {
    closeResource();
  }
}
----

include::../see.adoc[]

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
