FahrplanDatenGarten / pyhafas

A python client for the HAFAS (HaCon Fahrplan Auskunfts System)

Home Page:https://pyhafas.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle connection errors

vikramsg opened this issue · comments

commented

Hi,

This is a very nice project which I had been trying to use for my project. However, occasionally I hit the following error.

 ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

Usually, something like this can be handled by backoff, for example, in the Request class from urllib3. Would including this be interesting to you? Happy to contribute towards this.

Hey,
I currently don't have the time to implement this, but am happy to accept a PR :)
I'm not 100% sure how a good way of implementing would be, maybe a variable with a default on the profile class(es).

Just out of interest: With which profile did the error occur?

commented

With which profile did the error occur?

This is with the DBProfile.

I'm not 100% sure how a good way of implementing would be, maybe a variable with a default on the profile class(es).

I haven't looked at it in detail but I would think an optional parameter with retries and backoff_factor would need to be set somewhere and all requests calls should use this.

commented

Added a PR for this.

#31

Now solved in #31, thanks to you!