title: Guarantee that no error is thrown in Swift 3 do-catch?
body: <p>If I have an asynchronous function that throws an error, how can I make sure no error is thrown before some more functions are executed?</p>
  
  <pre><code>do {
      try foo()
  } catch {
      print("error: \(error)")
  }
  // HOW TO KNOW IF THE CALL WAS SUCCESSFUL HERE
  </code></pre>
  
  <p>I can have a variable that I change if an error is thrown, but it may be changed in some time if the call is asynchronous. I need to find a way to pause until <code>foo()</code> stops executing so I can be sure no error is thrown.</p>