title: In try catch statement catch is not being run after error inside async inside function. Javscript
body: <p>I've simplified it down here but this is basically what's going on, I have a function that runs an async function that has a try-catch block in it. Inside that, there is another function that gets run but it throws an error. That error isn't being caught by the catch block. Is there any way to fix that? </p>
  
  <p>I need the error to be thrown inside func2 and to be caught by that catch block. </p>
  
  <pre><code>func1();
  function func1(){
    (async () =&gt; {
      try {
        console.log("checkpoint 1");
        func2();
        async function func2(){
          lalalala; // error here
        }
      } catch {
        console.log("error"); // This never gets run
      }
    })();
  }
  
  </code></pre>