Skip to content
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

docs: fix syntax error of the example of inspecting errors #928

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

toshitanian
Copy link
Contributor

Fixed syntax error of the example of inspecting errors.
https://pkg.go.dev/google.golang.org/api#hdr-Inspecting_errors

This example seems missing if statement for result of type assertion.

// Inspecting errors
//
// All of the errors returned by a client's `Do` method may be cast to a
// `*googleapis.Error`. This can be useful for getting more information on an
// error while debugging.
  if _, err := svc.FooCall().Do(); err != nil {
      gErr, ok := err.(*googleapi.Error); ok {
          fmt.Println("Status code: %v", gErr.Code)
      }
  }

@toshitanian toshitanian requested review from yoshi-approver and a team as code owners March 16, 2021 10:26
@google-cla
Copy link

google-cla bot commented Mar 16, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Mar 16, 2021
@toshitanian toshitanian force-pushed the fix_example_of_inspecting_errors branch from 14d1d20 to 8730620 Compare March 16, 2021 10:27
@google-cla
Copy link

google-cla bot commented Mar 16, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@toshitanian
Copy link
Contributor Author

@googlebot I signed it!

@google-cla google-cla bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Mar 16, 2021
tbpg
tbpg previously approved these changes Mar 16, 2021
Copy link
Contributor

@tbpg tbpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tbpg tbpg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Mar 16, 2021
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Mar 16, 2021
@tbpg tbpg added the automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit label Mar 16, 2021
@gcf-merge-on-green gcf-merge-on-green bot dismissed tbpg’s stale review March 16, 2021 13:02

This review does not reference the most recent commit, and you are using the secure version of merge-on-green. Please re-review the most recent commit.

@tbpg tbpg merged commit 247d184 into googleapis:master Mar 16, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit label Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants