19963: Dedup interface type.
[arvados.git] / services / keep-web / cache.go
index db06d635092a3ee36daed2d3b72fe1b1b738a909..c73191103e01e0916a08f1314e19d02f53cb61b3 100644 (file)
@@ -5,6 +5,7 @@
 package keepweb
 
 import (
+       "errors"
        "net/http"
        "sync"
        "sync/atomic"
@@ -168,7 +169,7 @@ func (c *cache) GetSession(token string) (arvados.CustomFileSystem, *cachedSessi
        if user == nil || expired {
                user = new(arvados.User)
                err := sess.client.RequestAndDecode(user, "GET", "/arvados/v1/users/current", nil, nil)
-               if statusErr, ok := err.(interface{ HTTPStatus() int }); ok && statusErr.HTTPStatus() == http.StatusForbidden {
+               if he := errorWithHTTPStatus(nil); errors.As(err, &he) && he.HTTPStatus() == http.StatusForbidden {
                        // token is OK, but "get user id" api is out
                        // of scope -- return nil, signifying unknown
                        // user