Skip to content

Commit

Permalink
fix: ignore project not found error on linking
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Oct 22, 2024
1 parent 7adbe9b commit 329f495
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package link
import (
"context"
"fmt"
"net/http"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -243,7 +244,11 @@ func checkRemoteProjectStatus(ctx context.Context, projectRef string) error {
if err != nil {
return errors.Errorf("failed to retrieve remote project status: %w", err)
}
if resp.JSON200 == nil {
switch resp.StatusCode() {
case http.StatusNotFound:
// Ignore not found error to support linking branch projects
case http.StatusOK:
default:
return errors.New("Unexpected error retrieving remote project status: " + string(resp.Body))
}

Expand Down

0 comments on commit 329f495

Please sign in to comment.