Skip to content

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

fix: show API error message when an error occurs during branch creation (#44638)

Gildas Garcia60992fd8d890
diff --git a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx
index 15387a935c6..8df89e74b80 100644
--- a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx
@@ -254,8 +254,9 @@ export const CreateBranchModal = () => {
if (form.getValues('gitBranchName') !== branchName) return
setIsGitBranchValid(false)
form.setError('gitBranchName', {
- ...error,
- message: `Unable to find branch "${branchName}" in ${repoOwner}/${repoName}`,
+ message:
+ error?.message ??
+ `Unable to find branch "${branchName}" in ${repoOwner}/${repoName}`,
})
},
}