Skip to content

handle unknown non-api errors #245

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

Merged
merged 2 commits into from
Jun 25, 2024
Merged

handle unknown non-api errors #245

merged 2 commits into from
Jun 25, 2024

Conversation

gabor
Copy link
Contributor

@gabor gabor commented Jun 25, 2024

if you check the error-handling logic, it goes roughly like this:

	if err != nil {
		if apiErr, ok := err.(*googleapi.Error); ok {
                         // handle api error
		}
	}

        // process the result

so, if we have an error, that is not an api-error, we just don't handle it at all, and we continue processing the result (even though we have an error).

this PR simply adds an else branch to handle non-api errors.

how to test:

  1. run a google-sheets query, make sure it works
  2. turn off the internet on your laptop 😁 , and repeat the query
  3. you should see the error message "unknown error" (in main-branch at this point you'll see An error occurred within the plugin )

@gabor gabor requested a review from a team as a code owner June 25, 2024 11:15
@gabor gabor requested review from yesoreyeram, zoltanbedi, gwdawson and ivanahuckova and removed request for a team June 25, 2024 11:15
@gabor gabor merged commit 2599d3f into main Jun 25, 2024
3 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