{"record":{"id":"8cd61fbab016ab7b","repo":"chenhg5/cc-connect","slug":"slack-send-file-w","errorCode":null,"errorMessage":"slack: send file: %w","messagePattern":"slack: send file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/slack/slack.go","lineNumber":555,"sourceCode":"\trc, ok := rctx.(replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"slack: SendFile: invalid reply context type %T\", rctx)\n\t}\n\n\tname := file.FileName\n\tif name == \"\" {\n\t\tname = \"attachment\"\n\t}\n\n\t_, err := p.client.UploadFileV2Context(ctx, slack.UploadFileV2Parameters{\n\t\tReader:          bytes.NewReader(file.Data),\n\t\tFileSize:        len(file.Data),\n\t\tFilename:        name,\n\t\tChannel:         rc.channel,\n\t\tThreadTimestamp: rc.timestamp,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"slack: send file: %w\", err)\n\t}\n\treturn nil\n}\n\nvar _ core.FileSender = (*Platform)(nil)\n\nfunc (p *Platform) downloadSlackFile(url string) ([]byte, error) {\n\tif url == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty URL\")\n\t}\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\treq.Header.Set(\"Authorization\", \"Bearer \"+p.botToken)\n\tresp, err := core.HTTPClient.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s\", core.RedactToken(err.Error(), p.botToken))\n\t}\n\tdefer resp.Body.Close()\n","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/slack/slack.go#L537-L573","documentation":"Wrapped error from slack-go UploadFileV2Context when uploading and posting a generic file attachment to the reply channel/thread; the Slack file upload flow failed.","triggerScenarios":"Thrown at platform/slack/slack.go:555 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check files:write scope and file size limits","Retry transient network errors"],"exampleFix":null,"handlingStrategy":"retry","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"}