Skip to content

Instantly share code, notes, and snippets.

@lakshmantgld
Last active October 27, 2017 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lakshmantgld/2310f8faaebc9b4b6999fa5f73b7d42e to your computer and use it in GitHub Desktop.
Save lakshmantgld/2310f8faaebc9b4b6999fa5f73b7d42e to your computer and use it in GitHub Desktop.
module.exports.hello = (event, context, callback) => {
const errorResponse = {
statusCode: 400,
headers: {
"x-custom-header" : "my custom header value"
},
body: JSON.stringify({
message: 'Bad request Dude',
}),
};
// Do not use callback(new error(errorResponse)) in lambda-proxy
// error response
callback(null, errorResponse);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment