Skip to content

Commit

Permalink
better error from InitFromSamples
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Jun 28, 2024
1 parent 90ddc34 commit 2ec16e4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/pkg/cli/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,10 @@ func InitFromSamples(ctx context.Context, dir string, names []string) error {
return err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return ErrSampleNotFound
}
term.Debug(resp.Header)
tarball, err := gzip.NewReader(resp.Body)
if err != nil {
return err
return fmt.Errorf("failed to read tarball: %w", err)
}
defer tarball.Close()
tarReader := tar.NewReader(tarball)
Expand Down

0 comments on commit 2ec16e4

Please sign in to comment.