Commit 137fbc5a authored by Bernhard Geier's avatar Bernhard Geier
Browse files

do not quit on unparseable vcards

parent cffd840d
......@@ -68,7 +68,11 @@ def putCids(lp, args, config):
# get phone numbers from vcard
for vurl in getAllVcardLinks(url, auth):
r = requests.request("GET", vurl, auth=auth)
vcard = vobject.readOne(r.text)
try:
vcard = vobject.readOne(r.text)
except ParseError as e:
print(e)
continue
if "tel" in vcard.contents:
for telno in vcard.contents['tel']:
num = tidyPhoneNumber(config, telno.value)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment