druid-io / pydruid

A Python connector for Druid
Other
506 stars 194 forks source link

PyDruids clients throw to generic Exceptions OSError #263

Open sebtrack opened 3 years ago

sebtrack commented 3 years ago

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