title: Firebase function logs show failure even function succeeds
body: <p>I've got a firebase function that seems to work correctly, but the logs indicate failure.</p>
  <p>I'm seeing log messages like <code>Function execution took xxx ms. Finished with status: response error</code>.</p>
  <p>Here's a screenshot of the logs when the HTTP function is triggered.</p>
  <p><a href="https://i.stack.imgur.com/ArxI8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ArxI8.png" alt="image of logs" /></a></p>
  <p>It's strange that the logging level is &quot;Debug.&quot;  None of the <code>logger.error</code> statements in the code are triggered.</p>
  <p>The code itself is not complicated but even when I simplify it down to this, I'm seeing the error message in the logs.</p>
  <pre><code>export const shirtOrders = functions
    .runWith({
      timeoutSeconds: 300,
      memory: &quot;512MB&quot;,
    })
    .https.onRequest(async (request: any, response: any) =&gt; {
      cors(request, response, async () =&gt; {
        logger.info(&quot;Hello&quot;);
  
        response.status(201).send(JSON.stringify({ result: &quot;ok&quot; }));
      });
    });
  </code></pre>
  <p>Does anyone have any suggestions for how to troubleshoot this?</p>