File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 99from google .auth .transport .requests import Request
1010from google .auth .credentials import Credentials
1111
12+ from gcsa .exceptions import FailedToAuthenticateError
13+
1214
1315class AuthenticatedService :
1416 """Handles authentication of the `GoogleCalendar`"""
@@ -123,6 +125,9 @@ def _get_credentials(
123125 except WSGITimeout :
124126 print ('Authentication flow timed out. Please try again.' )
125127
128+ if credentials is None :
129+ raise FailedToAuthenticateError
130+
126131 if save_token :
127132 with open (token_path , 'wb' ) as token_file :
128133 pickle .dump (credentials , token_file )
Original file line number Diff line number Diff line change 1+ class FailedToAuthenticateError (Exception ):
2+ 'Failed to authenticate to the Google API'
You can’t perform that action at this time.
0 commit comments