Comments (5)
@justmobilize Are you still experiencing this issue?
payload = resp.json()
is only thrown when the status is 200
, for 503 it raises APIError
with appropriate message
from lob-python.
Looking at code on master:
def parse_response(self, resp):
if resp.status_code == 504:
raise error.APIConnectionError(resp.content or resp.reason, # pragma: no cover
resp.content, resp.status_code, resp)
payload = resp.json()
if resp.status_code == 200:
return payload
elif resp.status_code == 401:
raise error.AuthenticationError(payload['error']['message'],
resp.content, resp.status_code, resp)
elif resp.status_code in [404, 422]:
raise error.InvalidRequestError(payload['error']['message'],
resp.content, resp.status_code, resp)
else: # pragma: no cover
raise error.APIError(payload['error']['message'], resp.content, resp.status_code, resp)
it parses before the resp.status_code
is evaluated. I would imagine it better to handle the 503
in the same way as the 504
since those are both from the web server, not the application
from lob-python.
Agreed.
@ami is anyone working on this?
If no, then I can send in a pull request to fix this.
from lob-python.
Closed due to inactivity, if it is still an issue please re-open. Thank you!
from lob-python.
This is still an issue @pdufour
from lob-python.
Related Issues (20)
- Parsing a 504 error HOT 7
- Syntax error on line 43 "except Exception, 3:" HOT 7
- import issue on AWS Lambda HOT 5
- in `list()` endpoint, cannot specify `metadata` with more than 1 key HOT 2
- Ink-Free Area Alignment HOT 1
- Is there a way to specify a timeout for requests? HOT 3
- Is there a way to specify the API key to use on a per-call or per-endpoint basis? HOT 2
- Add coveralls ingestion to GH actions
- Changelog HOT 1
- Add version 5 to pypi if it's ready for usage? HOT 2
- Cannot retrieve Bank Account Information or Send Checks using lob_python HOT 4
- Check validation fails for certain valid amounts, but check is sent anyway HOT 2
- SyntaxError when importing CreativeWritable HOT 3
- ApiTypeError in last version
- Importing MultipleComponents or MultipleComponentsList raises SyntaxError HOT 1
- Support querying on metadata
- Use Src directory instead of lob in all examples HOT 4
- add instructions for running examples HOT 1
- missing requirements.txt file for examples 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 lob-python.