Skip to content

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

handle string error (#34725)

Saxon Fletcher9549464ec9b9
diff --git a/apps/studio/data/edge-functions/edge-function-body-query.ts b/apps/studio/data/edge-functions/edge-function-body-query.ts
index 09deda90a94..2086fbaff2a 100644
--- a/apps/studio/data/edge-functions/edge-function-body-query.ts
+++ b/apps/studio/data/edge-functions/edge-function-body-query.ts
@@ -41,8 +41,14 @@ export async function getEdgeFunctionBody(
})
if (!parseResponse.ok) {
- const error = await parseResponse.json()
- handleError(error)
+ const { error } = await parseResponse.json()
+ handleError(
+ typeof error === 'object'
+ ? error
+ : typeof error === 'string'
+ ? { message: error }
+ : { message: 'Unknown error' }
+ )
}
const { files } = await parseResponse.json()