Updating error messages and debug info

This commit is contained in:
Richard Propst 2021-09-30 10:15:35 -07:00
parent d36d1f9470
commit 17f8f365d1

View File

@ -5,13 +5,15 @@ import * as Sentry from '@sentry/nextjs'
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
try {
console.log('try api')
console.log('*** Headers ***')
console.log(req.headers)
throw new Error("API throw error test")
res.status(200).json({ name: "John Doe" });
}
catch (ex) {
console.log('caught exception')
Sentry.captureException(ex)
res.status(500).json({ error: "cannot complete request"});
res.status(500)
}
};