Created
September 12, 2017 09:01
-
-
Save rts-rob/3e2ad058de0642c7cd94589ad968f5cd to your computer and use it in GitHub Desktop.
Helper function for building JSON errors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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