{"record":{"id":"9bca1e90ab02deab","repo":"chenhg5/cc-connect","slug":"err-error","errorCode":null,"errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"core/api.go","lineNumber":257,"sourceCode":"\t}\n\ts.mu.RUnlock()\n\n\tif !ok {\n\t\tif req.Project == \"\" {\n\t\t\thttp.Error(w, \"project is required (multiple projects configured)\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\thttp.Error(w, fmt.Sprintf(\"project %q not found\", req.Project), http.StatusNotFound)\n\t\treturn\n\t}\n\n\tworkDir := req.WorkDir\n\tif workDir == \"\" {\n\t\tworkDir = req.CWD\n\t}\n\tif req.Message != \"\" || len(req.Images) > 0 || len(req.Files) > 0 {\n\t\tif err := engine.SendToSessionWithOptions(req.SessionKey, req.Message, req.Images, req.Files, SendOptions{WorkDir: workDir, AtUsers: req.AtUsers, AtAll: req.AtAll}); err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(req.Audios) > 0 {\n\t\tif err := engine.SendAudiosToSession(req.SessionKey, req.Audios); err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(req.Videos) > 0 {\n\t\tif err := engine.SendVideosToSession(req.SessionKey, req.Videos); err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t}\n","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/api.go#L239-L275","documentation":"The API send handler propagated a failure from Engine.SendToSessionWithOptions — the project was resolved, but delivering the message/images/files to the named session failed (unknown session key, agent session error, or attachment processing failure). The underlying error text is returned verbatim as the HTTP error body.","triggerScenarios":"Thrown at core/api.go:257 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the returned error text to identify the underlying session/agent failure","Verify the session_key exists and its agent session is running","Fix attachment inputs (valid images/files) if the error mentions media processing"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}