title: how to handle NSFileHandle writeData method exception?
body: <p>To log any message on file I am using <code>writeData</code> method of <code>NSFileHandle</code>. Sometimes this method throws an exception but I can not handle it because code is written in swift. </p>
  
  <p>Is there any work around ? </p>
  
  <p>I have tried this :</p>
  
  <pre><code>I have tried this : NS_INLINE NSException * _Nullable tryBlock(void(^_Nonnull tryBlock)(void)) {
  @try {
      tryBlock();
  }
  @catch (NSException *exception) {
      return exception;
  }
  return nil;
  </code></pre>