Skip to content

Commit 46352f3

Browse files
committed
fix(supabase): check response.ok before parsing storage_create_signed_url
Matches the pattern already applied to the new signed-upload-url tool this session — a non-2xx response now surfaces Supabase's actual error message instead of the generic "did not return a signed URL path" one. (cherry picked from commit 9f40427)
1 parent 7d4e086 commit 46352f3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎apps/sim/tools/supabase/storage_create_signed_url.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ export const storageCreateSignedUrlTool: ToolConfig<
8686
throw new Error(`Failed to parse Supabase storage create signed URL response: ${parseError}`)
8787
}
8888

89+
if (!response.ok) {
90+
throw new Error(
91+
`Failed to create signed URL: ${data.message || data.error || response.statusText}`
92+
)
93+
}
94+
8995
const relativePath = data.signedURL || data.signedUrl
9096
if (!relativePath) {
9197
throw new Error('Supabase did not return a signed URL path in its response')

0 commit comments

Comments
 (0)