analytics-python icon indicating copy to clipboard operation
analytics-python copied to clipboard

Invalid base class for APIError

Open pecheneff opened this issue 3 years ago • 0 comments

We have a business logic which sends some events. In order to trigger retry logic on errors we catch some errors there e.g. requests.exceptions.ConnectionError and analytics.request.APIError.

When APIError raises we get a TypeError with the following message 'catching classes that do not inherit from BaseException is not allowed'. I suppose it's due to APIError has Exception as a parent class and it should be replaced with BaseException.

Probably APIError can be inherited from Exception but it might be helpful to call super().__init__() inside it's constructor.

pecheneff avatar Oct 13 '22 10:10 pecheneff