Closed benjaminwestern closed 5 days ago
Hi @benjaminwestern , Thanks for the PR, this is definitely in the right direction. I have added some comments to hopefully make the implementation better
@ashish10alex added an isAuthenticated flag and a seperate verifyAuthentication and checkAuthentication functions
@ashish10alex I have also now added the ability for the user to determine if they want an interval type check (by default) or if they would instead prefer to only attempt to recreate the client on error
Thanks for the additions, @benjaminwestern
When unauthenticated and performing a dry-run, the following error messages are now displayed:
Error creating BigQuery client: Error: Unable to detect a Project Id in the current environment. To learn more about authentication and Google APIs, visit: https://cloud.google.com/docs/authentication/getting-started
If the issue is authentication-related, I suggest refining the message "BigQuery client not available" to be more descriptive. For example:
"Could not initiate a connection to BigQuery. Please ensure you are authenticated and try again. How to authenticate with ADC"
This would provide clearer guidance to users encountering authentication issues.
Thanks @HampB I will update the returned text based on a forbidden vs an expired or non-active ADC
Thanks a lot @benjaminwestern , I tested this again and looks good to me. I'll merge the PR now. We can revisit the above error message semantics later after we have some real world usage plus if any new user complains of them being unintuitive.
Also, thanks @HampB for the help with the review :)
This should 100% resolve the issues experienced in: Issue 53