diff --git a/client.go b/client.go index cb2fb69..07ab3e9 100644 --- a/client.go +++ b/client.go @@ -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) diff --git a/client_test.go b/client_test.go index 2dfd156..2ea60dc 100644 --- a/client_test.go +++ b/client_test.go @@ -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) +}