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

Error out nicely when URL is not working #300

Closed
mbaldessari opened this issue Nov 28, 2015 · 3 comments
Closed

Error out nicely when URL is not working #300

mbaldessari opened this issue Nov 28, 2015 · 3 comments

Comments

@mbaldessari
Copy link

Noticed the following when trying to sync birthdays from facebook via an outdated URL (url tweaked as it contains sensitive data):

Syncing my_fb_birthdays
debug: Loaded status for my_fb_birthdays
debug: GET https://www.facebook.com/ical/b.php?uid=1234&key=123
debug: {'User-Agent': 'vdirsyncer'}
debug: None
debug: Sending request...
debug: Removing latin1 fallback
debug: 200
debug: {'date': 'Sat, 28 Nov 2015 20:01:07 GMT', 'connection': 'keep-alive', 'content-type': 'text/html', 'x-fb-debug': 'bRvdRr8zA63qGdgOjMmL+kIWrBxq5esLAvykehGG7M1M5lqEETqWWs/6tBKz4mBrL8woQlW59YzTanA6iz7c/w==', 'content-length': '55'}
debug: Spiacenti, questo indirizzo non è valido o è scaduto.
Unhandled exception occured for my_fb_birthdays.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdirsyncer/cli/tasks.py", line 58, in sync_collection
    force_delete=force_delete
  File "/usr/lib/python2.7/site-packages/vdirsyncer/sync.py", line 169, in sync
    b_info.prepare_idents(storage_a.read_only)
  File "/usr/lib/python2.7/site-packages/vdirsyncer/sync.py", line 104, in prepare_idents
    for href, etag in self.storage.list():
  File "/usr/lib/python2.7/site-packages/vdirsyncer/storage/http.py", line 149, in list
    for item in split_collection(r.text):
  File "/usr/lib/python2.7/site-packages/vdirsyncer/utils/vobject.py", line 132, in split_collection
    for main in _Component.parse(text, multiple=True):
  File "/usr/lib/python2.7/site-packages/vdirsyncer/utils/vobject.py", line 251, in parse
    stack[-1].props.append(line)
IndexError: list index out of range

Might be nice to try and error out a bit more informatively. This happened with 0.7.3

@untitaker
Copy link
Member

Agreed.

@untitaker
Copy link
Member

This should be fixed in master. Is it sufficient @mbaldessari?

@mbaldessari
Copy link
Author

Looking much better, thanks again!

Unhandled exception occured for my_fb_birthdays.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdirsyncer/cli/tasks.py", line 58, in sync_collection
    force_delete=force_delete
  File "/usr/lib/python2.7/site-packages/vdirsyncer/sync.py", line 169, in sync
    b_info.prepare_idents(storage_a.read_only)
  File "/usr/lib/python2.7/site-packages/vdirsyncer/sync.py", line 104, in prepare_idents
    for href, etag in self.storage.list():
  File "/usr/lib/python2.7/site-packages/vdirsyncer/storage/http.py", line 149, in list
    for item in split_collection(r.text):
  File "/usr/lib/python2.7/site-packages/vdirsyncer/utils/vobject.py", line 132, in split_collection
    for main in _Component.parse(text, multiple=True):
  File "/usr/lib/python2.7/site-packages/vdirsyncer/utils/vobject.py", line 255, in parse
    'for more information.'.format(i + 1))
ValueError: Parsing error at line 1. Check the debug log for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants