code: func NewErr(r *http.Response) error {
  	if r.StatusCode >= http.StatusOK && r.StatusCode < http.StatusMultipleChoices {
  		return nil
  	}
  
  	switch r.StatusCode {
  	case http.StatusUnauthorized:
  		return transport.ErrAuthenticationRequired
  	case http.StatusForbidden:
  		return transport.ErrAuthorizationFailed
  	case http.StatusNotFound:
  		return transport.ErrRepositoryNotFound
  	}
  
  	return plumbing.NewUnexpectedError(&Err{r})
  }
docs: // NewErr returns a new Err based on a http response