You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library was created before Go 1.13 where error wrapping was introduced. So, it did not wrap errors, which made error handling at the caller side a bit tricky.
This library was created before Go 1.13 where error wrapping was introduced. So, it did not wrap errors, which made error handling at the caller side a bit tricky.
For instance, when opening an unknown bucket, the HTTP 404 error was replaced by a custom "Unknown bucket" error.
https://github.com/jacobsa/gcloud/blob/master/gcs/conn.go#L191-L192
This error is hard to be handled by the caller. However, if we wrap the internal http error like this:
On the user side, such error can be casted back to an 404, and properly handled:
The text was updated successfully, but these errors were encountered: