title: Why won't this Azure time triggered function fail?
body: <p>I'd like to know why my function is succeeding, even though I'm purposely throwing an exception inside the function. I created a new timer function and all I did is added a try/catch block and an always throwing error:</p>
  <pre><code>module.exports = async function (context, myTimer) {
    try {
      if (myTimer.isPastDue) {
        context.log('Node is running late!');
      }
      context.log('TEST');
      throw 'Error occurred';
    } catch (err) {
      context.log(err);
    }
  };
  </code></pre>
  <p>After deploying the above function to Azure and manually triggering it, will result in a succeeded function execution and the logs showing 'TEST' but not 'Node is running late!':</p>
  <pre><code>2022-04-08T13:32:30Z   [Information]   TEST
  2022-04-08T13:32:30Z   [Information]   Executed 'Functions.TEST' (Succeeded, Id=..., Duration=36ms)
  </code></pre>
  <p>the <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=javascript&amp;source=docs" rel="nofollow noreferrer">docs</a> only state that I should use a try/catch at the highest level of the function. I couldn't find any information on why this function would succeed with an error happening in execution.</p>
  <p>Any help will be appreciated, many thanks in advance!</p>