Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Fetch and XML Parse being thrown in pairs, instead of preventing further exceptions #2

Open
cohaolain opened this issue Jan 4, 2020 · 0 comments
Labels
invalid This doesn't seem right

Comments

@cohaolain
Copy link
Owner

Issue

Currently, if an API Fetch issue occurs, it will be followed by an XML Parse error. We shouldn't even try to parse an invalid API response (which would then just be NoneType.

API Fetch Error HTTPConnectionPool(host='api.irishrail.ie', port=80): Max retries exceeded with url: /realtime/realtime.asmx/getCurrentTrainsXML (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f74e1fe8520>: Failed to establish a new connection: [Errno 110] Connection timed out'))
XML Parse Error a bytes-like object is required, not 'NoneType'
API Fetch Error HTTPConnectionPool(host='api.irishrail.ie', port=80): Max retries exceeded with url: /realtime/realtime.asmx/getCurrentTrainsXML (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f74e1fe8310>: Failed to establish a new connection: [Errno 110] Connection timed out'))
XML Parse Error a bytes-like object is required, not 'NoneType'
API Fetch Error HTTPConnectionPool(host='api.irishrail.ie', port=80): Max retries exceeded with url: /realtime/realtime.asmx/getCurrentTrainsXML (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f74e20c6490>: Failed to establish a new connection: [Errno 110] Connection timed out'))
XML Parse Error a bytes-like object is required, not 'NoneType'

Proposed Fix

Ensure failed API calls don't have their responses parsed to begin with.

@cohaolain cohaolain added the invalid This doesn't seem right label Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant