pinecone-io / pinecone-java-client

The official Java client for the Pinecone vector database
https://www.pinecone.io
Apache License 2.0
36 stars 13 forks source link

Added ApiException as a cause to mapHttpStatusError #127

Closed kkashkovskii closed 5 months ago

kkashkovskii commented 5 months ago

Problem

When the request fails before sending a request / receiving an HTTP response, the exception cause is ignored, and the client returns an empty error message:

Caused by: io.pinecone.exceptions.PineconeUnmappedHttpException: null
    at io.pinecone.exceptions.HttpErrorMapper.mapHttpStatusError(HttpErrorMapper.java:21)
    at io.pinecone.clients.Pinecone.handleApiException(Pinecone.java:794)
    at io.pinecone.clients.Pinecone.describeIndex(Pinecone.java:441) 

Solution

Added the apiException as the cause HttpErrorMapper.mapHttpStatusError to make debugging easier.

Type of Change

Test Plan

not required