Skip to content

Commit

Permalink
wrap one more error and remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
michalg9 committed Mar 1, 2024
1 parent 9479ae0 commit f9ea543
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions internal/spacelift/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package client

import (
"context"
"net/http"

"github.com/pkg/errors"
"github.com/shurcooL/graphql"
Expand Down Expand Up @@ -64,7 +63,7 @@ func New(endpoint, keyID, keySecret string) (*client, error) {

session, err := session.FromAPIKey(ctx, httpClient)(endpoint, keyID, keySecret)
if err != nil {
return nil, err
return nil, errors.Wrap(err, "failed to create spacelift session")
}

spaceliftClient := spacectl.New(httpClient, session)
Expand All @@ -79,11 +78,3 @@ func (c *client) Mutate(ctx context.Context, mutation interface{}, variables map
func (c *client) Query(ctx context.Context, query interface{}, variables map[string]interface{}, opts ...graphql.RequestOption) error {
return c.wraps.Query(ctx, query, variables, opts...)
}

func (c *client) URL(format string, a ...interface{}) string {
return c.wraps.URL(format, a...)
}

func (c *client) Do(req *http.Request) (*http.Response, error) {
return c.wraps.Do(req)
}

0 comments on commit f9ea543

Please sign in to comment.