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

feat: print an error message when ~/.gcalcli_oauth deserialization fails #733

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

adrien-n
Copy link
Contributor

@adrien-n adrien-n commented Sep 5, 2024

At the moment, only a backtrace is printed and it doesn't make what's going on obvious.

This is especially important now as the migration from oauth2client to google-auth comes with a format change for this file and anyone who had been using gcalcli successfully before is likely to encounter this error.

I've tested this change the following way in a container:

# echo x > .gcalcli_oauth
# gcalcli list
Couldn't parse /root/.gcalcli_oauth.
The file may be corrupt or be incompatible with this version of gcalcli. It probably has to be removed and provisioning done again.
[backtrace]

This doesn't cover the file being empty but a) this is quite unlikely to happen, b) the cause would be completely different; moreover the exception is quite clear: EOFError: Ran out of input

Helps with #691.

At the moment, only a backtrace is printed and it doesn't make what's
going on obvious.

This is especially important now as the migration from oauth2client to
google-auth comes with a format change for this file and anyone who had
been using gcalcli successfully before is likely to encounter this error.
Copy link
Collaborator

@dbarnett dbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, thanks!

Merging...

@dbarnett dbarnett merged commit a113c5a into insanum:main Sep 5, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants