Skip to content

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

o11y(docs): more descriptive errors (#36892)

Charis677e6a8b0847
diff --git a/apps/docs/app/api/utils.ts b/apps/docs/app/api/utils.ts
index 10f51e47b76..652ea444e59 100644
--- a/apps/docs/app/api/utils.ts
+++ b/apps/docs/app/api/utils.ts
@@ -101,7 +101,10 @@ export class CollectionQueryError extends Error {
): CollectionQueryError {
const fetchFailedFor =
countError && dataError ? 'count and collection' : countError ? 'count' : 'collection'
- return new CollectionQueryError(`Failed to fetch ${fetchFailedFor}`, {
+ let message = `Failed to fetch ${fetchFailedFor}`
+ if (countError) message += `: CountError: ${countError.message}`
+ if (dataError) message += `: CollectionError: ${dataError.message}`
+ return new CollectionQueryError(message, {
count: countError,
data: dataError,
})