Skip to content

Commit 60992fd

Browse files
authored
fix: show API error message when an error occurs during branch creation (supabase#44638)
## Problem When a user creates a branch but their GitHub account does not have access to the repo, the UI shows a generic branch not found message. ## Solution The API actually returns a more detailed message. Show it instead of the generic one. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed error message handling when creating branches from invalid Git references. Users will now receive appropriate error messages when attempting to use a non-existent branch. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 8aeacc6 commit 60992fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ export const CreateBranchModal = () => {
254254
if (form.getValues('gitBranchName') !== branchName) return
255255
setIsGitBranchValid(false)
256256
form.setError('gitBranchName', {
257-
...error,
258-
message: `Unable to find branch "${branchName}" in ${repoOwner}/${repoName}`,
257+
message:
258+
error?.message ??
259+
`Unable to find branch "${branchName}" in ${repoOwner}/${repoName}`,
259260
})
260261
},
261262
}

0 commit comments

Comments
 (0)