Skip to content
Snippets Groups Projects

Add prerequisite for this 401 errors

Merged Tian Gao requested to merge 32-improve_unauthorized_error_message into main
All threads resolved!
Files
2
@@ -127,6 +127,12 @@ func (gl *GitLab) Completions(prompt string) ([]deps.Dependency, error) {
continue
}
// 401 error needs special attention
// we instruct users to review the prerequisites of xray
if resp.StatusCode == http.StatusUnauthorized {
return nil, fmt.Errorf("Request failed (code 401). Please verify that the current project is in a root namespace or its descendant namespaces where the root namespace has a duo pro add-on. Refer to this page for more details: https://docs.gitlab.com/ee/user/project/repository/code_suggestions/repository_xray.html#enable-repository-x-ray")
}
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("Request failed (code %v)", resp.StatusCode)
}
Loading