title: Error handling in Lambda with API Gateway proxy integration
body: <p>From what I understand, when using Lambda proxy integration one must return <code>statusCode</code> and <code>body</code> in order to return any meaningful error information to the HTTP client.</p>
  
  <p>My python code is below:</p>
  
  <pre><code>import json
  import traceback
  
  def lambda_handler(event, context):
  
      try:
          result = business_logic()        
          return {
              'statusCode': 200,
              'body': json.dumps(result)    
          }
  
      except Exception as e:
          error = {
              "type": e.__class__.__name__,
              "message": str(e),
              "traceback": traceback.format_exc()
          }
          return {
              'statusCode': 502,
              'body': json.dumps(error)
          }
  </code></pre>
  
  <p>My problem is, I'd like to make use of Lambda and Cloudwatch's handy monitoring interface (e.g. being able to trigger off lambda errors) but since lambda in this code is handling all errors and returning a value, I think lambda will have 0% error rate. </p>
  
  <p>Is there an alternative approach which still uses proxy integration and passes error info?</p>