chore(docs-gpt): better logs for application errors

This commit is contained in:
Greg Richardson committed 2023-02-06 23:20:51 -07:00
1 parent 5cac2faee2
commit 8bc6a6b7b5
1 file changed
+6 -3
+6 -3
View File
@@ -168,11 +168,14 @@ serve(async (req) => {
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
}
)
} else if (err instanceof ApplicationError) {
// Print out application errors with their additional data
console.error(`${err.message}: ${JSON.stringify(err.data)}`)
} else {
// Print out unexpected errors as is to help with debugging
console.error(err)
}
// Print out unexpected errors to help with debugging
console.error(err)
// TODO: include more response info in debug environments
return new Response(
JSON.stringify({