title: await/async how to handle unresolved promises
body: <p>How do you handle promises that do not resolve?</p>
  
  <p>Example:</p>
  
  <pre><code>class Utils {
      static async thisFunctionOnlyResolvesWhenPassed2AndNeverRejects(number: number) {
          return new Promise((resolve, reject) =&gt; {
              if(number === 2) {
                  resolve('ok')
              }
          })
      }
  }
  
  console.log(await Utils.thisFunctionOnlyResolvesWhenPassed2AndNeverRejects(2))
  // this will print "ok" because 2 is passed and the promise is resolved
  
  console.log(await Utils.thisFunctionOnlyResolvesWhenPassed2AndNeverRejects(5))
  // this will crash the program silently 
  </code></pre>
  
  <p><code>uncaughtException</code> and <code>unhandledRejection</code> return nothing when the promise is unresolved. Adding a <code>try/catch</code> around the await doesn't work (no errors). Finally, the only thing that works is using <code>Promise.then</code> instead of <code>await</code>.</p>
  
  <p>Problem is the code base is riddled with <code>async/await</code> and Promises that sometimes resolve (depending on conditions)</p>
  
  <p><strong>Question</strong>: Is there a typescript flag I can add to detect a missing resolve/reject? or maybe an automated way to transpile all the <code>async/await</code> to use <code>Promise.then</code>?</p>
  
  <p>When using a debugger, the program stops after the Promise and it is difficult to find which function/promise has a missing resolve/reject.</p>
  
  <p>Rewriting all the <code>async/await</code> calls to use <code>Promise.then</code> is my last resort.</p>