Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

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

Greg Richardson8bc6a6b7b5e7
diff --git a/supabase/functions/clippy-search/index.ts b/supabase/functions/clippy-search/index.ts
index 5b4a33d464e..8a80354e429 100644
--- a/supabase/functions/clippy-search/index.ts
+++ b/supabase/functions/clippy-search/index.ts
@@ -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({