Skip to content

Commit

Permalink
fix(v2/apierror): use errors.As in FromError (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed May 5, 2022
1 parent ba7c534 commit f30f05b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion v2/apierror/apierror.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
package apierror

import (
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -215,7 +216,8 @@ func FromError(err error) (*APIError, bool) {

ae := APIError{err: err}
st, isStatus := status.FromError(err)
herr, isHTTPErr := err.(*googleapi.Error)
var herr *googleapi.Error
isHTTPErr := errors.As(err, &herr)

switch {
case isStatus:
Expand Down

0 comments on commit f30f05b

Please sign in to comment.