Skip to content

Instantly share code, notes, and snippets.

@richardgrantserverless
Created June 1, 2022 17:40
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 richardgrantserverless/436cadac680c55a0327c9fed77a7cbd3 to your computer and use it in GitHub Desktop.
Save richardgrantserverless/436cadac680c55a0327c9fed77a7cbd3 to your computer and use it in GitHub Desktop.
module.exports.hello = async (event, context) => {
try {
// do some real stuff but it throws an error, oh no!
throw new Error('new error')
} catch (error) {
context.captureError(error)
}
return {
statusCode: 400,
body: JSON.stringify({ error: 'my nice error message' }),
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment