Skip to content

Client exception handling improvements #134

@oclyke

Description

@oclyke

Right now I am finding (the hard way) that my calls, such as query_async, may result in an exception from pyarrow such as "pyarrow._flight.FlightInternalError". These exceptions are really hard to use, as a consumer of the API. There are two problems:

  1. They are hard to predict: I don't know where to find the documentation which will tell me what to expect.
  2. They are hard to react to: not only do I need to now know about pyarrow but I need to implement some parsing for an "InternalError" of some other module.

Arguably the second issue is a bigger problem for me, but the first is tough too.

Proposed solution is that methods such as write, query, and query_async handle these internal exceptions themselves and, when appropriate, raise a well-defined exception to the consumer (e.g. raise InfluxDBClient3NotFoundException(f"No database with the name '{database}' exists on the server."))

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions