Skip to content

Instantly share code, notes, and snippets.

@rts-rob
Created September 12, 2017 09:01
Show Gist options
  • Save rts-rob/3e2ad058de0642c7cd94589ad968f5cd to your computer and use it in GitHub Desktop.
Save rts-rob/3e2ad058de0642c7cd94589ad968f5cd to your computer and use it in GitHub Desktop.
Helper function for building JSON errors.
function buildError(statusCode, message) {
const error = {
statusCode: statusCode,
body: JSON.stringify({
error: message
})
};
return error;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment