I remember seeing it here that this pattern is not safe, with the alternatives suggested to catch obj-c call exceptions directly in obj-c without involving swift.
// some obj-c call wrapper:
-(BOOL)callWrapper:(...)params error:(NSError**)error {
@try {
// some call here known to throw Obj-C exceptions
call(params);
return YES;
} catch (NSException *exception) {
*error = ...
return NO;
}
}
and then call this "call" from Swift - that's safe.
Even better if you know the individual call behaviour: e.g. if it throws on, say, index out of range - validate index first in your wrapper and when it's invalid return an error right away without calling the underlying method.
Catching Objective-C exceptions has never been allowed in Swift.
The NSFileHandle methods that throw exceptions seem to all be deprecated now, in favor of methods that have an explicit error parameter (which are imported into Swift as throwing methods).
You can find more information about interoperability with Objective-C errors and exceptions here: