{"record":{"id":"5cd683cab1b7f555","repo":"goharbor/harbor","slug":"s-v","errorCode":null,"errorMessage":"%s: %v","messagePattern":"%s: %v","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"src/common/api/base.go","lineNumber":205,"sourceCode":"func (b *BaseAPI) ParseAndHandleError(text string, err error) {\n\tif err == nil {\n\t\treturn\n\t}\n\tif e, ok := err.(*commonhttp.Error); ok {\n\t\tb.RenderError(e.Code, fmt.Sprintf(\"%s: %s\", text, e.Message))\n\t\treturn\n\t}\n\tb.SendInternalServerError(fmt.Errorf(\"%s: %v\", text, err))\n}","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/common/api/base.go#L187-L223","documentation":"Legacy legacy-API error wrapper in BaseAPI.ParseAndHandleError: if the error is a *commonhttp.Error it renders the known code/message, otherwise it wraps ANY unknown error as '<text>: %v' and returns HTTP 500. It is a generic catch-all — the message carries the caller's context label plus the underlying error.","triggerScenarios":"Thrown at src/common/api/base.go:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the prefixed text and wrapped error to find the failing operation","Upgrade callers to return harbor lib/errors so proper status codes are sent","Fix the underlying operation named by the <text> prefix"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}