-
Notifications
You must be signed in to change notification settings - Fork 430
Adding exception text to exit message for invalid clientsecrets #530
Conversation
if message: | ||
if str(e): | ||
message = 'Error: %s\n================\n%s' % (str(e), message) | ||
sys.exit(message) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Thanks for this contribution. Do you mind adding or augmenting the existing test for this? |
@@ -2210,8 +2210,10 @@ def flow_from_clientsecrets(filename, scope, redirect_uri=None, | |||
client_info['client_id'], client_info['client_secret'], | |||
scope, **constructor_kwargs) | |||
|
|||
except clientsecrets.InvalidClientSecretsError: | |||
except clientsecrets.InvalidClientSecretsError as e: | |||
if message: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
5692970
to
85fd0b3
Compare
@jonparrott @nathanielmanistaatgoogle, I updated this PR again and added a test for this (slightly modified a previous test). Travis passed on my branch, but still waiting to launch for this PR. I had to use positional argument specifiers in the |
Great, this looks good to me. @nathanielmanistaatgoogle to do the final review. |
Change content looks good; please amend your commit log message to meet the guidelines. |
85fd0b3
to
432035e
Compare
If `clientsecrets.InvalidClientSecretsError` is raised with additional text and a predefined failure message is given, include exception text in the exit message.
432035e
to
4fe7d69
Compare
Commit message updated. |
Waiting for travis. |
Thanks for your contributions, @pferate! |
This is to address a problem found in googleapis/google-api-python-client#228.
This will give users the text from the InvalidClientSecretsError exception, in addition to the generic message that it currently does. The format of the message can be modified, if needed.