include::../why.adoc[]

[source,cpp,diff-id=1,diff-type=noncompliant]
----
void openResource() {
  @throw [NSException exceptionWithName:@"FileNotFoundException" reason:@"File Not Found on System" userInfo:nil];
}

void fun() {
  @try {
    openResource();
  }
  @finally {
    closeResource();
    @throw ... ; // Noncompliant - will mask previous exception
  }
}
----

[source,cpp,diff-id=1,diff-type=compliant]
----
void openResource() {
  @throw [NSException exceptionWithName:@"FileNotFoundException" reason:@"File Not Found on System" userInfo:nil];
}

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

include::../rspecator.adoc[]