title: What to do about potential error 'throws' before submitting app to app store?
body: <p>Lets say we have an app that we are about to submit to the app store... but it contains the following code:</p>
  
  <pre><code>    try? audioSession.setCategory(AVAudioSessionCategoryAmbient)
          if error != nil {
          // this should never happen
          }
  
      try? audioSession.setActive(true)
          if error != nil {
          // this should never happen
          }
  </code></pre>
  
  <p>We have to "try" the setCategory method because it "throws" ... but I have no idea why it would ever throw/fail.</p>
  
  <p>I feel like this will be viewed as trash code... and that I should be doing more than just saying "this should never happen," but if an error did happen, I would have no idea what to do with it.</p>
  
  <p><a href="https://developer.apple.com/documentation/avfoundation/avaudiosession/1616583-setcategory" rel="nofollow noreferrer">This</a> documentation doesn't give any reasons why there would be an error, either.</p>
  
  <p>Am I supposed to make a pop-up window that says "sorry... we encountered an error while attempting to set the category on the audioSession singleton instance... but the reason for this error is beyond this app's control.  Press OK so the app can close.  This never happened during app testing... so I have no idea why it happened to you now... must have something to do with your device.  Maybe reboot?  Better luck next time."</p>
  
  <p>Or am I supposed to "elegantly handle the error?"  How can I do that when I don't know what the potential error "throws" are and more importantly the potential reasons behind them.</p>
  
  <p>Thanks for any suggestions. :)</p>