Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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