Refactor app/services/gitlab/namespaces/get_service.rb
Summary
Refactor app/services/gitlab/namespaces/get_service.rb
(Gitlab::Namespaces::GetService
)
Improvements
Be more explicit about using customer token vs admin token
Also, when using customer token results in a 401, the customer token is deleted, which could be an unexpected side-effect.
There is a Gitlab::Admin::GetNamespaceService
which uses the admin token.
Raise an error if API call was not successful
We can check how callers use this class. If most callers end up raising an error anyway, we could raise it in this class itself.