Skip to content

Commit fb5f533

Browse files
committed
[metoro-io#67] Fix Client's ReadResource method
1 parent 1fa18e0 commit fb5f533

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

client.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,13 @@ func (c *Client) ReadResource(ctx context.Context, uri string) (*ResourceRespons
235235
return nil, errors.New("invalid response type")
236236
}
237237

238-
var resourceResponse resourceResponseSent
238+
var resourceResponse ResourceResponse
239239
err = json.Unmarshal(responseBytes, &resourceResponse)
240240
if err != nil {
241241
return nil, errors.Wrap(err, "failed to unmarshal resource response")
242242
}
243243

244-
if resourceResponse.Error != nil {
245-
return nil, resourceResponse.Error
246-
}
247-
248-
return resourceResponse.Response, nil
244+
return &resourceResponse, nil
249245
}
250246

251247
// Ping sends a ping request to the server to check connectivity

0 commit comments

Comments
 (0)