From ea52112a9321acad511ca4c5a04e2a1dfbf75fc0 Mon Sep 17 00:00:00 2001 From: Guilherme Carvalho Date: Thu, 5 Oct 2023 17:57:30 -0300 Subject: [PATCH] Add route that throws exception --- src/api/throw.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/api/throw.ts diff --git a/src/api/throw.ts b/src/api/throw.ts new file mode 100644 index 00000000..ee487556 --- /dev/null +++ b/src/api/throw.ts @@ -0,0 +1,14 @@ +import type { GatsbyFunctionRequest, GatsbyFunctionResponse } from 'gatsby' + +const foo = async () => { + throw Error('This was intended') +} + +const handler = async ( + _req: GatsbyFunctionRequest, + _res: GatsbyFunctionResponse +) => { + await foo() +} + +export default handler