title: How to trigger a failure in an azure function http trigger, WITH a custom error response
body: <p>I cannot find a way to fail a http call to a nodejs azure function, and include a custom error response. </p>
  
  <p>Calling context.done() allows for a custom response (but not indicated as a failure in Application Insights)</p>
  
  <p>Calling context.done(true, XXX) does create a failure, but returns a generic error to the user (no matter what I put in XXX):</p>
  
  <pre><code>{"id":"b6ca6fb0-686a-4a9c-8c66-356b6db51848","requestId":"7599d94b-d3f2-48fe-80cd-e067bb1c8557","statusCode":500,"errorCode":0,"message":"An error has occurred. For more information, please check the logs for error ID b6ca6fb0-686a-4a9c-8c66-356b6db51848"}
  </code></pre>
  
  <p>This is just the latest headache I have ran into in trying to get a fast web api running on Azure funcs. If you cant track errors, than it should hardly be called "Application Insights". Any ideas? </p>