-
Notifications
You must be signed in to change notification settings - Fork 114
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
Error handling for 404 (e.g.) #131
Comments
Implementation for the both mentioned ideas can be found here: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Recently I tried handling '404 Not found'-errors while loading GPX-data by the 'error'-event, as the README reads like this should be the way to handle it.
This failed, as the corresponding parts of the code (
_load_xml
) only call the event-firing callback (in_parse
) if the return code equals 200.As a rather quick'n'dirty workaround, I added 'error'-event-firing in
_load_xml
forreq.status == 404
for my use-case and would like to request comments or ideas how to handle this (more) properly.Ideas so far:
req.status == 200
-condition. Should/Would keep a single point of firing 'error', but fails currently, as_parse_xml_data
expects a proper (gpx-)xml-document. Maybe add a try-catch block around calling_parse_xml_data
?else
-branch and fire 'error' in_load_xml
. From my point of view this might be a problem for206 Partial
, e.g., given I'm not that familiar with how XMLHttpRequest is designed regarding this.The text was updated successfully, but these errors were encountered: