aboutsummaryrefslogtreecommitdiffstats
path: root/clients/http/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'clients/http/common.go')
-rw-r--r--clients/http/common.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/clients/http/common.go b/clients/http/common.go
index a4b86bd..703208b 100644
--- a/clients/http/common.go
+++ b/clients/http/common.go
@@ -48,11 +48,14 @@ func NewHTTPError(r *http.Response) error {
return nil
}
- err := &HTTPError{r}
- if r.StatusCode == 404 || r.StatusCode == 401 {
- return core.NewPermanentError(common.ErrNotFound)
+ switch r.StatusCode {
+ case 401:
+ return common.ErrAuthorizationRequired
+ case 404:
+ return common.ErrRepositoryNotFound
}
+ err := &HTTPError{r}
return core.NewUnexpectedError(err)
}