Skip to content

Commit

Permalink
fix(logger): convert multierror to err
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov committed Feb 9, 2024
1 parent 85363c9 commit 4db9faa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (d *aivenClient) Do(ctx context.Context, operationID, method, path string,
}

defer func() {
err = multierror.Append(rsp.Body.Close())
err = multierror.Append(rsp.Body.Close()).ErrorOrNil()
}()

b, err := io.ReadAll(rsp.Body)
Expand Down
15 changes: 15 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ func TestNewClient(t *testing.T) {

assert.Equal(t, 1, found)
}

func TestProjectGetServiceLogs(t *testing.T) {
token := os.Getenv("AIVEN_TOKEN")
if token == "" {
t.Skip("token is required for the test")
}

c, err := NewClient(DebugOpt(true))
require.NoError(t, err)

ctx := context.Background()
out, err := c.ServiceGet(ctx, "dev-sandbox", "gordon-gf")
assert.Nil(t, err)
assert.NotNil(t, out)
}

0 comments on commit 4db9faa

Please sign in to comment.