{"record":{"id":"a9c7953f4e1d7cf2","repo":"goharbor/harbor","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/dockerhub/adapter.go","lineNumber":175,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc (a *adapter) listNamespaces() ([]string, error) {\n\tresp, err := a.client.Do(http.MethodGet, listNamespacePath, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.StatusCode/100 != 2 {\n\t\tlog.Errorf(\"list namespace error: %s\", string(body))\n\t\treturn nil, fmt.Errorf(\"%s\", string(body))\n\t}\n\n\tnamespaces := NamespacesResp{}\n\terr = json.Unmarshal(body, &namespaces)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Debugf(\"got namespaces %v by calling the listing namespaces API\", namespaces)\n\treturn namespaces.Namespaces, nil\n}\n\n// CreateNamespace creates a new namespace in DockerHub\nfunc (a *adapter) CreateNamespace(namespace *model.Namespace) error {\n\tns, err := a.getNamespace(namespace.Name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"check existence of namespace '%s' error: %v\", namespace.Name, err)\n\t}\n","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/dockerhub/adapter.go#L157-L193","documentation":"Error \"%s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/dockerhub/adapter.go:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}