api-lambdas.js
function toDefaultErrorResponseBody(error) {
  const json = error && error.toJSON();
  if (json) {
    if (json.httpStatus) {
      delete json.httpStatus; // don't really need `httpStatus` inside `body` too, since have it in response as `statusCode`
    }
    if (json.headers) {
      delete json.headers; // don't want error's `headers` inside `body`, since have more comprehensive `headers` in response
    }
  }
  return json;
}
function toDefaultErrorResponseBody(error) {
  const json = error && error.toJSON();
  if (json) {
    if (json.httpStatus) {
      delete json.httpStatus; // don't really need `httpStatus` inside `body` too, since have it in response as `statusCode`
    }
    if (json.headers) {
      delete json.headers; // don't want error's `headers` inside `body`, since have more comprehensive `headers` in response
    }
  }
  return json;
}
function toDefaultErrorResponseBody ( error ) { const json = error && error . toJSON ( ) ; if ( json ) { if ( json . httpStatus ) { delete json . httpStatus ; // don't really need `httpStatus` inside `body` too, since have it in response as `statusCode` } if ( json . headers ) { delete json . headers ; // don't want error's `headers` inside `body`, since have more comprehensive `headers` in response } } return json ; }
A default conversion from an error to an error response body for a Lambda Proxy error response
@param {AppError} error - an error to convert
@return {Object} an error response body
A default conversion from an error to an error response body for a Lambda Proxy error response