Comments (5)
Could be that this is something that should be handled in either urllib3 or requests (also see urllib3/urllib3#367)
from pydora.
These types of errors should be handled by the HTTPAdapter
in RetryingSession
, or at least that was the theory. I'll try subclassing that to provide better error handling for this case.
from pydora.
I've been hacking on something at https://github.com/jcass77/pydora/blob/709904df881b5d96bf13b1d592d64db1214aedb5/pandora/transport.py#L27-L83
It uses a generic retry decorator to retry the call if the specified exception(s) occur. It is not HTTP session aware at all, so not sure if it will be suitable as a retry handler.
@mcrute is this approach worth considering or would you prefer to handle it differently?
from pydora.
That seems like a pretty good approach. The API is already aware of login timeout exceptions and will retry those so unless there's some other class of error that can't be fixed with a retry this should work.
You may also be able to simplify the logic by using a while loop and decrementing an integer like:
retries_left = 10
while retries_left > 0:
... retry ...
retries_left -= 1
from pydora.
Merged #31
from pydora.
Related Issues (20)
- Broken pipe on play station HOT 5
- Unicode Encode Error HOT 1
- Inquiry: How to use a library on project? HOT 4
- Becoming an approved pandora developer HOT 2
- Continuous Song Cycling HOT 3
- Continuous skipping of tracks HOT 10
- Break pycrypto dependency HOT 3
- I Need Help HOT 5
- Remote VLC Backend HOT 1
- Issues with creating a new station HOT 3
- Dropping Python 2.x - 3.4 Support HOT 3
- Search for station, select it, and get station HOT 12
- Add docs and examples HOT 3
- Unable to login HOT 1
- Help understand ads in Pandora and Login timeout (refresh) HOT 2
- PyDora pydora-configure configuration script error HOT 1
- Error: pandora.errors.InvalidAuthToken: Invalid Auth Token HOT 17
- Pydora fails to start HOT 2
- Error: pandora.errors.InvalidAuthToken: Invalid Auth Token HOT 1
- Instructions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydora.