feat: print an error message when ~/.gcalcli_oauth deserialization fails #733
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.