The error handling does not allow to manage exceptions when using PyDruid. For example, it's hard to catch an HTTP Error 504: Gateway Time-out and then initiate a retry. A connection refused would, on the other hand, be an exception to log with Sentry, etc. All the fine-grained HTTP client exceptions get the generic label OSError with a string describing it, which is a bad design decision.
The error handling does not allow to manage exceptions when using PyDruid. For example, it's hard to catch an HTTP Error 504: Gateway Time-out and then initiate a retry. A connection refused would, on the other hand, be an exception to log with Sentry, etc. All the fine-grained HTTP client exceptions get the generic label OSError with a string describing it, which is a bad design decision.
https://github.com/druid-io/pydruid/blob/98cab4d9c2a08a35667b26a15dee21bdb77422b4/pydruid/client.py#L554-L577