mirror of
https://github.com/rclone/rclone.git
synced 2025-12-23 11:43:50 +00:00
vendor: update all dependencies
This commit is contained in:
16
vendor/google.golang.org/api/GettingStarted.md
generated
vendored
16
vendor/google.golang.org/api/GettingStarted.md
generated
vendored
@@ -128,3 +128,19 @@ For a more complete example, see
|
||||
[urlshortener.go](https://github.com/google/google-api-go-client/tree/master/examples/urlshortener.go)
|
||||
in the [examples directory](https://github.com/google/google-api-go-client/tree/master/examples/).
|
||||
(the examples use some functions in `main.go` in the same directory)
|
||||
|
||||
## Error Handling
|
||||
|
||||
Most errors returned by the `Do` methods of these clients will be of type
|
||||
[`googleapi.Error`](https://godoc.org/google.golang.org/api/googleapi#Error).
|
||||
Use a type assertion to obtain the HTTP status code and other properties of the
|
||||
error:
|
||||
|
||||
```go
|
||||
url, err := svc.Url.Get(shortURL).Do()
|
||||
if err != nil {
|
||||
if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user