Last active
July 7, 2020 03:35
-
-
Save 5t33/55e9ec268234d98316ff04df35e236c9 to your computer and use it in GitHub Desktop.
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
const formatApiError = (error) => JSON.stringify({ | |
isBase64Encoded: false, | |
statusCode: error.statusCode, | |
headers: { | |
"Content-Type": typeof error.body === "string" ? "text/html" : "application/json", | |
}, | |
body: error.body | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment