Update failed to create PR error message (vibe-kanban) (#779)

* Done! I've updated the error message in [`github_service.rs`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-93a7-update-fai/crates/services/src/services/github_service.rs#L208-L218). Now when a PR creation fails because the base branch doesn't exist (and it's not already "main"), users will see:

`"Base branch 'feature-branch' does not exist: [error]. Perhaps you meant to use main as your base branch instead?"`

The hint only appears when the requested base branch is not "main", keeping the message clean for cases where "main" itself doesn't exist.

* fmt
This commit is contained in:
Louis Knight-Webb
2025-09-18 16:59:30 +01:00
committed by GitHub
parent 46d3f3c7df
commit aedbce5c4f

View File

@@ -209,10 +209,17 @@ impl GitHubService {
))
.await
.map_err(|err| match GitHubServiceError::from(err) {
GitHubServiceError::Client(source) => GitHubServiceError::Branch(format!(
"Base branch '{}' does not exist: {}",
request.base_branch, source
)),
GitHubServiceError::Client(source) => {
let hint = if request.base_branch != "main" {
" Perhaps you meant to use main as your base branch instead?"
} else {
""
};
GitHubServiceError::Branch(format!(
"Base branch '{}' does not exist: {}{}",
request.base_branch, source, hint
))
}
other => other,
})?;