diff --git a/docs/config.rst b/docs/config.rst index 4c76469..9e5999a 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -185,6 +185,10 @@ Service to hardcode those into opensource software 4. Finally you should have a Client ID and a Client secret. Provide these in your storage config. +The ``token_file`` parameter should be a filepath where vdirsyncer can later +store authentication-related data. You do not need to create the file itself +(or write anything to it), only the folder around it. + You can select which calendars to sync on `CalDav settings page `_. diff --git a/vdirsyncer/storage/google.py b/vdirsyncer/storage/google.py index d6520cc..b4a451f 100644 --- a/vdirsyncer/storage/google.py +++ b/vdirsyncer/storage/google.py @@ -51,6 +51,11 @@ class GoogleSession(dav.DAVSession): token = json.load(f) except (OSError, IOError): pass + except ValueError as e: + raise exceptions.UserError( + 'Failed to load token file {}, try deleting it. ' + 'Original error: {}'.format(token_file, e) + ) def _save_token(token): with atomic_write(token_file, mode='w', overwrite=True) as f: