{"record":{"id":"b606bf258e7d3861","repo":"goharbor/harbor","slug":"d-s","errorCode":null,"errorMessage":"%d -- %s","messagePattern":"%d -- %s","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/dockerhub/adapter.go","lineNumber":223,"sourceCode":"\tb, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresp, err := a.client.Do(http.MethodPost, createNamespacePath, bytes.NewReader(b))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resp.StatusCode/100 != 2 {\n\t\tlog.Errorf(\"create namespace error: %d -- %s\", resp.StatusCode, string(body))\n\t\treturn fmt.Errorf(\"%d -- %s\", resp.StatusCode, body)\n\t}\n\n\treturn nil\n}\n\n// getNamespace get namespace from DockerHub, if the namespace not found, two nil would be returned.\nfunc (a *adapter) getNamespace(namespace string) (*model.Namespace, error) {\n\tresp, err := a.client.Do(http.MethodGet, getNamespacePath(namespace), 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","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/dockerhub/adapter.go#L205-L241","documentation":"Error \"%d -- %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/dockerhub/adapter.go:223 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"}