Skip to content

Commit

Permalink
Improve error message for missing LTS binaries (bazelbuild#639)
Browse files Browse the repository at this point in the history
* Improve error message for missing LTS binaries

Follow-up to bazelbuild#636.

* Remove obsolete import
  • Loading branch information
fweikert authored Nov 21, 2024
1 parent 1f492e5 commit 2d9b590
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions repositories/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package repositories

import (
"encoding/json"
"errors"
"fmt"
"log"
"strconv"
Expand Down Expand Up @@ -42,7 +41,11 @@ func (gcs *GCSRepo) GetLTSVersions(bazeliskHome string, opts *core.FilterOpts) (
return []string{}, err
}
if len(matches) == 0 {
return []string{}, errors.New("there are no LTS releases or candidates")
var suffix string
if opts.Track > 0 {
suffix = fmt.Sprintf(" for track %d", opts.Track)
}
return []string{}, fmt.Errorf("could not find any LTS Bazel binaries%s", suffix)
}
return matches, nil
}
Expand Down

0 comments on commit 2d9b590

Please sign in to comment.